Tag: til
-
In the world of static file hosting there are plenty of solutions. I picked now.sh. It’s free, easy to use and works well. I have had one problem with now.sh so far, it creates a new URL everytime you push. It’s a feature that I dont need in some cases, here’s how to solve. Put this in package.json:
Replace YOUR_APP_NAME by the name of your app. Then go to your now.json and add/change:{ "scripts": { "deploy": "now && now alias && now remove YOUR_APP_NAME --safe -y" } }
Replace YOUR_UNIQUE_SUBDOMAIN by your unique subdomain. Just run"name": "YOUR_APP_NAME", "alias": "YOUR_UNIQUE_SUBDOMAIN.now.sh",
yarn deploy
. -
Touch
is mainly known for creating files.Touch
main purpose is actually to update the file’s timestamp. From the man:The touch utility sets the modification and access times of files. If any file does not exist, it is created with default permissions.
-
Using
Debug.toString
is really helpful to help debug the model but the format of the output is hard to read. Looking for solution I stumbled upon this gem(not the ruby gem). I changed it to work in elm 0.19 and fix a minor issue when usingcustom type
for theModel
. Here’s the final result on Gist. -
When you need to return more than one element you have few solutions.
Wrap with an element
<div> <span>1</span> <span>2</span> </div>
Return a list (requires a key)
function List() { return [<span key='1'>1</span>, <span key='2'>2</span>] }
Use Fragment (16.2.0+)
<Fragment> <span>1</span> <span>2</span> </Fragment>
Use empty tag (some kind of alias for Fragment)
<> <span>1</span> <span>2</span> </>
-
If you need to reuse the reuse the last argument from the previous command this is for you:
Last command is equivalent totouch config.js vi !$
Bonus:vi config.js
echo $?
will display the exit code of therevious command!!
will re-execute the previous command,sudo !!
-
I love calendars and shell has a way to display the calendar for the current month
$ cal