Skip to content

Instantly share code, notes, and snippets.

gaearon /
Last active Jun 17, 2021
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](
redism /
Created Apr 26, 2017
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
"₩" = ("insertText:", "\`");
vitan / load_csv_dict
Created Jan 20, 2015
How to load .csv as dict in Python, skipping initial space and quotechar
View load_csv_dict
#!/usr/bin/env python
Given file example.csv, with the following contents:
key1: 'I am value1'
key2: 'I am value2'
import csv
RichAyotte / create-tables.js
Created Apr 11, 2014
Initial Sequelize Migration with existing database.
View create-tables.js
// Inspired by
var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));
module.exports = {
up: function(migration, DataTypes, done) {
var db = migration.migrator.sequelize;
fs.readFileAsync(__dirname + '/initial.sql', {encoding: 'utf8'})
.then(function(initialSchema) {
var tables = initialSchema.split(';');