ctrl+shift+T
: opens terminalcd <directory-name>
: change directoryls'
: Lists all files and directories in a directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setAttributes function for setting multiple attributes to a particular element at once! | |
function setAttributes(element, attributes) { | |
for(let key in attributes) { | |
element.setAttribute(key, attributes[key]) | |
} | |
} | |
// Call it like this: | |
setAttributes(element, {"class": "center", "width": "100%", "height": "100%", ...}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FieldProps } from 'formik' | |
import React from 'react' | |
import Select, { Option, ReactSelectProps } from 'react-select' | |
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({ | |
options, | |
field, | |
form, | |
}) => ( | |
<Select |
Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create
. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.
Note that on Heroku, you must always use master
as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch
seen below (in this example, we push the local staging
branch to the master
branch on heroku.
$ git remote add staging https://git.heroku.com/staging-app.git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const schema = { | |
"type": "object", | |
"properties": { | |
"users": { | |
"type": "array", | |
"minItems": 3, | |
"maxItems": 5, | |
"items": { | |
"type": "object", | |
"properties": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scroll_start = 0; | |
var startchange = $('#scroll-color'); | |
var offset = startchange.offset(); | |
$(document).scroll(function () { | |
scroll_start = $(this).scrollTop(); | |
if (scroll_start > offset.top) { | |
$('.navigation').css('background', '#e63c2d'); | |
} else { | |
$('.navigation').css('background', 'transparent'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment", | |
"field": {}, | |
"#another-field": "Another comment", | |
"another-field": {}, | |
"/*stuff": "Be careful to use them when you have full control of the content :)", | |
"stuff": [], | |
"bla": "bla" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2012 Akseli Palén. | |
* Created 2012-07-15. | |
* Licensed under the MIT license. | |
* | |
* <license> | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files | |
* (the "Software"), to deal in the Software without restriction, | |
* including without limitation the rights to use, copy, modify, merge, |
NewerOlder