teleren/devto huggingface dataset:
How to force Unity to target x64 or ARM64 for macOS builds
Tags: unity3d, applesilicon, m1
Published: 2020-12-24 15:52:17

---
title: How to force Unity to target x64 or ARM64 for macOS builds
published: true
description: EditorUserBuildSettings is the answer
tags: unity3d, applesilicon, m1
//cover_image: https://direct_url_to_image.jpg
---

Unity 2020.2 adds support for Apple Silicon binaries (both native & Universal 2.) This means we need to decide which CPU type to use when building our game, either by hand or by code. How do you do this by code?  

# TL;DR

The API for switching the CPU type is not directly exposed as of 2.1f1, but you can use this workaround:

```csharp
using UnityEditor;

// All but the last argument must be as they appear
EditorUserBuildSettings.SetPlatformSettings(
    "Standalone",
    "OSXUniversal",
    "Architecture",
    "x64" // Possible values: "x64" "ARM64" "x64ARM64"
);
```

# Why

My project is built via Jenkins, which means the builds are kicked from the command line arguments.  
Apparently, when you update to Unity 2020.2, the CPU type defaults to Universal 2 (x64 + ARM64.) However, it's often the case that you want not to use ARM64 because of the libraries you use. And it _was_ the case for me.

# How?

So I dug into my project files to find out that `${PROJECT_ROOT}/Library/EditorUserBuildSettings.asset` remembers my build settings. This was bad news because this file was ignored by Git and I had three separate repository clones - one for development, the rest for building (to build dev/prod in parallel.) I needed to somehow replicate this file from the code!

I opened this asset file thinking this was a YAML file to find it being a _binary_ file, but a large portion of it could be read as ASCII. I found this in the last of the file:

```
Standalone....iPhone....OSXUniversal....Architecture....x64....CreateXcodeProject....false
```

(this portion contained a ***lot*** of non-printing chars, which was replaced with `....`. The number of periods is _not_ to scale.)

Unfortunately, Unity does not expose these variables as an API, but there is [a method you can tap into these raw values](https://docs.unity3d.com/2020.2/Documentation/ScriptReference/EditorUserBuildSettings.SetPlatformSettings.html). The linked documentation is for one of the overloads, but you also have this one:

```csharp
EditorUserBuildSettings.SetPlatformSettings(
    buildTargetGroupStr, builTargetStr, settingName, settingValue
);
```

As for `buildTargetGroupStr` etc., you need to set it as it appears in the .asset file - making the method look like the first code block.

Put that code in one of your `IPreprocessBuildWithReport` implementation, and you should be good to go.

Do keep in mind though, if you have this code in your project, you will ***not*** be able to specify your CPU type from the Build Settings window (it'll be ignored!)

---

Corrections are welcome, I wrote this late at night :P
Laravel Docker Apple Silicon
Tags: laravel, php, docker, apple
Published: 2020-12-24 15:45:08

Hello!

Early present for the folks who may use docker for development! Manage to setup docker local enviroment on my apple silicon.

https://github.com/soarez98/docker-apple-silicon

Let me know if any of you are facing some issues with docker on m1 chips.

Merry christmas and happy builds!
Merry #JavaScriptmas, Devs!
Tags: javascript, javascriptmas, codecrook, scrimba
Published: 2020-12-24 15:38:00

In last month of the scariest year of our generation, Scrimba launched the #JavaScriptmas challenge to divert our mind from loads of crap happening in the world, while strengthening our JavaScript knowledge.   

Along with thousands of JavaScript enthusiast around the world, I participated in this exciting challenge. Some challenges were easy. Some were little challenging, but most importantly, it helped me polish my coding brain.

Here are my solutions to the challenges. Please check them out and leave suggestions in comments if you have any.

[1. Candies](https://scrimba.com/scrim/co5234650a951ad44bbfc72f4)
[2. Deposit Profit](https://scrimba.com/scrim/co8d546098591d4dbf915aa0a)
[3. Chunky Monkey](https://scrimba.com/scrim/co4a0435ab6d37f8f80de7d63)
[4. Century from Year](https://scrimba.com/scrim/co6034fbbbef8d353ac704b21)
[5. Reverse a String](https://scrimba.com/scrim/co75b4e1d92578ae80e5a3725)
[6. Sort by length](https://scrimba.com/scrim/co87646d2b1efa7ae16d63463)
[7. Count Vowel Consonant](https://scrimba.com/scrim/co9614ee28a978ccb831cfa04)
[8. The Rolling Dice](https://scrimba.com/scrim/co1ac49dbba1a89bc41ba28eb)
[9. Sum of odd Fibonacci numbers](https://scrimba.com/scrim/cocfb4fff84ed27124559a3f6)
[10. Adjacent Elements product](https://scrimba.com/scrim/co9494bbfb765376e8a79222c)
[11. Avoid obstacles](https://scrimba.com/scrim/co8fb43f09bfb1f27a55b587e)
[12. Valid Time](https://scrimba.com/scrim/co717470e982d5a5e8787c81e)
[13. Extract Each kth](https://scrimba.com/scrim/co5294134a83c1f9c9c2311cd)
[14. Maximum adjacent different](https://scrimba.com/scrim/co46046dba1c530de8a0a3880)
[15. Carousel](https://scrimba.com/scrim/coe0a43d5826f9d0e241616dd)
[16. Insert Dashes](https://scrimba.com/scrim/co3a64afc8d919317f9b08731)
[17. Different Symbols Naive](https://scrimba.com/scrim/co8cc4b7992b7f25e2b2a2ff6)
[18. Array Previous Less](https://scrimba.com/scrim/cof1a4a2788390f995559d661)
[19. Alphabet subsequence](https://scrimba.com/scrim/codfd488b944a1e948bd6fe0e)
[20. Domain Type](https://scrimba.com/scrim/co2664e80b9786477ce36206d)
[21. Sum of two](https://scrimba.com/scrim/co4de445baccdcfbf7bc8dc0b)
[22. Extract Matrix Column](https://scrimba.com/scrim/co7854e3c813daa8c7b80a54d)
[23. Social Media Input](https://scrimba.com/scrim/cod184636b25a5fbee08d0520)
[24. Test your agility](https://scrimba.com/scrim/co3854243a92975e4e8009270)

Merry Christmas, everyone! 🎉

Namaskar 🙏🏼
Progress: Improved UI, update and delete for models, and some data on the dashboard
Tags: dohackathon
Published: 2020-12-24 15:37:54

## Improved UI
I switched out UI-Kit for MD-Bootstrap. I think it looks much better.

## Auth pages
### Login
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l7j80zpplp36j21dqwnh.png)
### Register
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zbend6m48gga01dom75v.png)

## Dashboard
This was supposed to be my main focus but I got side-tracked by redoing the whole UI so I'm a bit behind. Just dummy data for now.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j4fqal7kapdb8kmdes9l.png)

## Jobs
### Viewing all jobs
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/31khbpspqreu50vcvtdk.png)
### Creating
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hcywu92wjn1l848891o4.png)
### Updating
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ichdd2znzfagz7v2k0at.png)
### Deleting
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/od0e4wiyxrixvq7whhz3.png)

The creating, updating and deleting views are similar for contacts and vehicles.

## Contacts
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mvwdsgz8isu3oquj33zx.png)

## Vehicles
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q2pmslfyds62e32xpi1f.png)

## Seeding data
There's a button to seed dummy data which comes in handy since this is a dev environment.

## Next steps
- Implementing CRUD for Staff
- Fixing [this](https://github.com/wangonya/auto-repair-saas/issues/12) bug
- Improving the dashboard
TIL: Use a keyboard shortcut to quickly toggle light and dark mode on MacOs.
Tags: productivity, macos, webdev
Published: 2020-12-24 15:33:45

When developing a site with a `light` and `dark` modes, it gets bothersome to change your settings to see results.

Especially if you're testing `javascript` that listens for the change in user preferences — or if you've animated the change between modes.

I work on a MacBook and would open settings to do this, i'd miss the `css transitions`. It was annoying. 

But there's a fix for this. You can **set up a keyboard shortcut to toggle between `light` and `dark` mode with `automator`**, here's how:

## Add workflow to Automator

1. Open `automator`
2. Click `file` ▸ `new`
3. Select `quick action` ▸ `choose`
4. Select "workflow receives current `no input` in `any application`" from the dropdown options.
5. In the long list of `actions` on the left find `Run AppleScript`. Then Double-Click to add it to your workflow.
6. Paste the following commands in your workflow:```
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
```
7. Save the Workflow, call it something sensible like "toggle dark mode"

Click the the play button `▶️` to see the script in action.

## Add the shortcut

1. Open `System Preferences`
2. Click `keyboard`  ▸ `Shortcuts`
3. Click `services` on the left.
4. Scroll down and find `general`, your workflow is there.
5. Double Click on the right hand side of your workflow, where it says `none`
6. Type the shortcut you want to use. I use `shift-command-7`.

I have my `appearance` preferences set to `auto` and this shortcut doesn't interfere with it. When the time comes, it sets itself to the correct setting. 

*Source: I found this tip by googling it then finding [this post on lifehacker](https://lifehacker.com/switch-between-dark-and-light-mode-on-your-mac-with-thi-1838488087)*
Building Websites for Beginners: 10. CSS
Tags: beginners, css, webdev, tutorial
Published: 2020-12-24 15:31:25

# CSS
Whereas HTML is the language responsible for defining the content of a webpage, CSS is the language used to control its visual presentation. CSS stands for Cascading Style Sheets, a style-sheet being an external file<sup id="a1">[1](#f1)</sup> (sheet) that controls the look or visual layout (style) of a document. The cascade is the mechanism with which CSS determines which styles should be applied to an element, and we will explore how this works soon.

As we briefly alluded to in the section on HTML, the huge benefit of CSS is it allows us to separate the visual presentation of a document from the contents. By defining the look of a website in a separate .css file (which is then referenced from each .html document on the site) we can share it across every page on a website; instead of having to set our styles on each page, we can define it once and know that all elements will look the same on each page of the site. If we then want to update how something is displayed at a later date, we only have to do it in one location, instead of going through every page of the site and making the same change in each.

CSS also allows us to alter the visual presentation of the document depending on the characteristics of the device it is being rendered on; changing the layout between mobile and desktop, for instance, or removing all the colour when printed out<sup id="a2">[2](#f2)</sup>.

This flexability has allowed the development of 'responsive design': instead of having a different page for mobile devices and desktops, we can instead build websites that adapt to fit the devices they are being viewed on - so no matter what device our visitors are using, our pages will work for them.

Just like HTML, CSS files are simple text files that follow a specific type of formatting. Unlike HTML, however, CSS is not a markup language and  has its own unique rules. We will start to look at the syntax of CSS in the next chapter and throughout this section will apply what we are learning to our portfolio page from the previous section.

### Footnotes
<ol>
    <li id="f1">Technically, it is possible to add CSS styles directly to a HTML document, but that loses the tremendous flexability that keeping the visual presentation separate from the content allows us.</li>
    <li id="f2">Yes, a printer is a separate device on the web and can be given unique styles.</li>
</ol>

---
This is a chapter from my <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a> book, Building Websites for Beginners. You can read everything that I have written so far on the [book website](https://bezpowell.github.io/building_websites_for_beginners/), and can see the [source code on github](https://github.com/BezPowell/building_websites_for_beginners).
Advent of Code 2020 Solution Megathread - Day 24: Lobby Layout
Tags: adventofcode, challenge
Published: 2020-12-24 15:25:41

---
title: Advent of Code 2020 Solution Megathread - Day 24: Lobby Layout
published: true
description: We're flipping tiles on a grid... a hexagonal one!
tags: adventofcode, challenge
series: Advent of Code 2020
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/revn1tvll0ylayejzy2d.png
---

Christmas Eve is here!  Don't spend too much time on this one.  There's a holiday afoot!

## The Puzzle

In [today’s puzzle](https://adventofcode.com/2020/day/24), we've finally reached it to the resort at last.  Their lobby is being renovated and we're tasked with flipping tiles on an a hexagonal grid to figure out what the pattern is to look like.

## The Leaderboards

As always, this is the spot where I’ll plug any leaderboard codes shared from the community.

```
Ryan's Leaderboard: 224198-25048a19
```

If you want to generate your own leaderboard and signal boost it a little bit, send it to me either in a DEV message or in a comment on one of these posts and I'll add it to the list above.

## Yesterday’s Languages

Updated 07:25AM 12/24/2020 PST.

| Language   | Count |
|------------|-------|
| Python     |     1 |
| Haskell    |     1 |
| Rust       |     1 |

Merry Coding!
24 Days of Javascriptmas Challenge
Tags: javascript, scrimba, programming
Published: 2020-12-24 15:15:21

Hi my name is Fernando, usually I'm scare of writing post not sure why I feel like out of the water but this time since I completed the challenges is well deserve for me to write at least this post and maybe more in the future if when I get more comfortable with writing.

without further ado this are my javascriptmas challenges 

Day 1: [Candies](https://scrimba.com/scrim/co075438a8caaa9ac731eac19)
Day 2: [Deposit Profit](https://scrimba.com/scrim/coc0d4d68b12e711d3a539de5)
Day 3: [Chunky Monkey](https://scrimba.com/scrim/co5d84999a1a559e30bd46eeb)
Day 4: [Century From Year](https://scrimba.com/scrim/co5af4f28b6c7bd5ca55eb850)
Day 5: [Reverse a String](https://scrimba.com/scrim/co28c4fa0ad3c3c70823e281f)
Day 6: [Sort By Length](https://scrimba.com/scrim/coeb04b789c135ad6ea3e43b5)
Day 7: [Count Vowel Consonant](https://scrimba.com/scrim/co3dc41a9b1a10431f1e9e12d)
Day 8: [The Rolling Dice](https://scrimba.com/scrim/cob60400dafaf9258c2f33bbb)
Day 9: [sum Odd Fibonacci Numbers](https://scrimba.com/scrim/co0464a77a35225930b17fb52)
Day 10: [Adjacent Elements Product](put-link-here)
Day 11: [I'm an inline link](https://scrimba.com/scrim/co6394d2ca8751638b22a181e)
Day 12: [Valid Time](https://scrimba.com/scrim/co39b480590c84baae473fee6)
Day 13: [Extract Each Kth](https://scrimba.com/scrim/co0354167b2973bc805bb0641)
Day 14: [Maximal Adjacent Difference](https://scrimba.com/scrim/cof4b4f68a4de41881b491a68)
Day 15: [Carousel](https://scrimba.com/scrim/cod804f7091ba19134ddd05d9)
Day 16: [Insert Dashes](https://scrimba.com/scrim/co8a84764a3ffbc6090ada1c4)
Day 17: [Different Symbols Naive](https://scrimba.com/scrim/coc1c4def9c18a32b4823efa3)
Day 18: [Array Previous Less](https://scrimba.com/scrim/co08547d7b392d4873c39f829)
Day 19: [Alphabet Sequence](https://scrimba.com/scrim/cof4943acb2904172af6d75f5)
Day 20: [Domain Type](https://scrimba.com/scrim/co30f46d48fdc8877d7183ab2)
Day 21: [Sum of Two](https://scrimba.com/scrim/cod154122ba1b0f55f3c944b4)
Day 22: [Extract Matrix Column](https://scrimba.com/scrim/co1d94ebfae835050875b3a4a)
Day 23: [Social Media Input](https://scrimba.com/scrim/coaeb4a858503ffd7e146b9ad)
Day 24: [Test You Agility](https://scrimba.com/scrim/co971480b8e76ae6872d62f70)


Have a great Christmas Everyone
Head start with CSS Gradients to create images effects
Tags: css, html, beginners
Published: 2020-12-24 15:01:06

Sometimes we want to add a nice colors effect into our page images the CSS gradients can help to do it.

If you didn't work before with gradients no problem, I will give a quick overview of it.

The CSS gradient helps us to define smooth transitions between 2 o more colors, with directions.

In the `background-image` or `background`, using `linear-gradient` or `radial-gradient` we create gradients.

The following markup will help us to play with the CSS gradient.

{% jsfiddle [https://jsfiddle.net/danywalls4/jwq85pfa/51/](https://jsfiddle.net/danywalls4/jwq85pfa/51/) result,html,css %}

## linear-gradient and radius-gradient

Into the div we set the `background-image` with the `linear-gradiant` function. It requires at least 2 minimum 2 colors as parameters and by default the direction is top to bottom.

{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/53/ result,html,css %}

To change the directions, add before extra parameters like  `to right`, `to left`, `to top` or `to left corner` , `to right top`.

{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/56/ result,html,css %}

Also, we can mix up more than 2 colors, `background-image: radial-gradient(red, yellow, green);`

{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/58/ result,html,css %}

Another gradient is radius-gradient but the radius effect.

{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/61/ result,html,css %}

## Use gradient with images.

The gradient effect can be applied over images, instead use background-image, we will add it into the background property. 

First set the image path into the `url` function, only for show the image a bit nice add `no-repeat` and  `center / cover` to fit with container.

```css
background:  url("[https://images.unsplash.com/photo-1467003909585-2f8a72700288?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D)")no-repeat  center / cover`
```
{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/70/ result,html,css %}

Before the url image, use the linear-gradient function and  set 2 colors using `rgba()` function for the opacity.

> The rgba helps to defines colors using the Red-green-blue-alpha and alpha channel specifies the opacity of the color.

For example set the red to 255 and the alpha to 0.3 and we get the following effect.
```css
background: linear-gradient(rgba(255,0,0,0.3),rgba(255,0,0,0.4)), ...
```
{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/73/ result,html,css %}

Other example with the blue.
```css
background: linear-gradient(rgba(0,0,255,0.3),rgba(0,0,255,0.4)), ...
```
{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/74/ result,html,css %}

#That's it!
This is a quick overview with gradients in CSS, you can play with it and build great image effect in css like my last example.

{% jsfiddle https://jsfiddle.net/danywalls4/jwq85pfa/78/ result,html,css %}
https://jsfiddle.net/danywalls4/jwq85pfa/78/
Physiotherapy Equipment Manufacturer in Delhi
Published: 2020-12-24 14:57:16

We are engaged in manufacturing, supplying and exporting superior quality Physiotherapy Equipment Manufacturer like Laser Therapy Equipment, Interferential Therapy, Ultra Sound Therapy, Electronic Traction Unit, Muscle Stimulators, and Tens Channel etc. These equipment are available in various specifications and can be custom designed according to the demands of the clients. These are accessed by our clients at affordable prices in the markets.​
Building Animeccha - Epilogue
Tags: dohackathon, digitalocean, react, javascript
Published: 2020-12-24 14:56:08

## What I built
A web app where a user can scroll through some of my favorite anime scenes of all time !!

![wow](https://media.tenor.com/images/2849d31752c8d9fe0e45d0413831b4b9/tenor.gif)

### Category Submission: 
Random Roulette: A fun treat for anime fans !!

### App Link
[https://animeccha.com](https://animeccha.com)

### Screenshots
Desktop:
![Animeccha Desktop](https://dev-to-uploads.s3.amazonaws.com/i/2654o1hr821w35ocbtpt.png)

Mobile:
![Animeccha Mobile Dark](https://dev-to-uploads.s3.amazonaws.com/i/23khzogeo8tr174e4uu1.png)

Specific Anime Screen:
![Specific Anime Screen](https://dev-to-uploads.s3.amazonaws.com/i/qms8dj5zi9fb1y3hvetl.png)

Demo (Scrolling through the montage):
![Animeccha Demo](https://dev-to-uploads.s3.amazonaws.com/i/1tqvtroqthbnimw9rynj.gif)

### Description
There are basically three set of screens in this app.
- The first one is the home page where all the anime cards are listed. 
- One can tap/click on the respective card and go to the next screen which consists of included montages for that anime. 
- Tap/Click on the montage card and post that loading animation, scroll through it's frames !!

### Link to Source Code
[https://github.com/lapstjup/animeccha](https://github.com/lapstjup/animeccha) (with that sweet deploy button 🚀)

### Permissive License
[MIT it is !](https://choosealicense.com/licenses/mit/)

## Background
I have been an anime lover for a long time. Watched my first one i.e. Dragon Ball almost 12 years ago and since then have watched a lot of awesome ones !! 
There are a lot of scenes that just make you go **DAMN that artwork and storyboarding !!** and this app is my attempt to appreciate those. 

### How I built it 
If you haven't checked out my previous blogs then do for awesome gifs and content, but for those who believe in TLDR, the following happened :-
1. Vanilla JS POC.
2. POC to full fledged React app with routes.
3. Deployment to Netlify and leveraging Netlify LMS.
4. Creating static image server for local development and migrating from Netlify LMS to DigitalOcean Spaces + Imagekit.io.
5. Migrating the App from Netlify to DigitalOcean App Platform.

This was really fun to build and I am thankful to this category's existence and of course, this HACKATHON 😇 !!

P.S. - I will keep adding on more Animes and montages as time permits 😁!!