(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| { | |
| "name": "Inheritence", | |
| "cells": [ | |
| { | |
| "in": "// prototypal inheritence\n// http://oli.me.uk/2013/06/01/prototypical-inheritance-done-right/\n", | |
| "out": "3" | |
| }, | |
| { |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| # Solving unicode to ascii conversion error | |
| str1 = '\xc6\xe5\t\xc5\xba\xc6;\xe4y\xdf8\xd8U\xcb\xff\xaaT@\r&\x8c\xbd\x95v' | |
| print type(str1) | |
| str_in_ascii = str1.encode('base-64') | |
| print type(str_in_ascii) |
| #!/bin/bash | |
| cd ${1} | |
| for f in `find .*rc`; do | |
| echo $f | |
| tr -d '\15\32' < $f > $f.tr | |
| mv $f.tr $f | |
| done |
| adb reboot bootloader | |
| fastboot flash bootloader bootloader-hammerhead-HHZ11d.img | |
| fastboot reboot-bootloader | |
| fastboot flash radio radio-hammerhead-M8974A-1.0.25.0.17.img | |
| fastboot reboot-bootloader | |
| fastboot -w update image-hammerhead-krt16m.zip | |
| fastboot reboot-bootloader |
| * text=auto | |
| * text eol=crlf | |
| *.html text eol=crlf | |
| *.css text eol=crlf | |
| *.js text eol=crlf | |
| *.json text eol=crlf |
| import datetime | |
| import time | |
| # some datetime object | |
| dt = datetime.datetime.now() | |
| # get the seconds since epoch for that datetime | |
| print time.mktime(dt.timetuple()) |
| from flask import request, make_response, | |
| def any_response(data): | |
| ALLOWED = ['http://localhost:8888'] | |
| response = make_response(data) | |
| origin = request.headers['Origin'] | |
| if origin in ALLOWED: | |
| response.headers['Access-Control-Allow-Origin'] = origin | |
| return response |
| #!/bin/bash | |
| cd ~/backups | |
| folder=$(date +%Y%m%d) | |
| mkdir $folder && cd $folder | |
| mongodump -d sharurl | |
| tar -cvf dump.tar.gz ./dump | |
| rm -rf ./dump |