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
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* To use: copy this file to ~/Library/KeyBindings/ | |
* after that any Cocoa applications you launch will inherit these bindings | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* |
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
>>> list1, list2 = [1,2,3,4,5], [6,7,8,9,10] | |
>>> for (e1, e2) in zip(list1, list2): print e1, e2 | |
... | |
1 6 | |
2 7 | |
3 8 | |
4 9 | |
5 10 |
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
>>> a, b = 1, 2 | |
>>> print a, b | |
1 2 | |
>>> b, a = a, b | |
>>> print a, b | |
2 1 |
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
>>> items = [1,2,3,4,5] | |
>>> if 3 in items: print "hit!!" | |
... | |
hit!! |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="UTF-8"> | |
<head> | |
<style> | |
body { | |
margin : 0; | |
padding : 0; | |
background-color: #eee; | |
font-size: 25px; |
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 b64 = canvas.toDataURL() | |
var $img = new Image(); | |
$img.crossOrigin = 'Anonymous'; | |
$img.src = b64; | |
// もとに戻すとき null を入れるといいよ。 | |
$img.crossOrigin = null; | |
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
// ----------------------------------------------------------------- | |
// MDN: bind | |
// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind | |
// ----------------------------------------------------------------- | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (oThis) { | |
if (typeof this !== "function") { | |
// closest thing possible to the ECMAScript 5 internal IsCallable function | |
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); |
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
/** | |
* web server: express | |
* | |
* リクエストを別のHTTPサーバーに問い合わせるプログラム | |
* - リクエストヘッダー等はコピーしていないです。 | |
*/ | |
var fs = require('fs'); | |
var path = require('path'); | |
var zlib = require('zlib'); |
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
[loggers] | |
keys=root,example.default,gunicorn.access,gunicorn.error | |
[logger_root] | |
level=DEBUG | |
handlers=example | |
[logger_example.default] | |
level=DEBUG | |
handlers=example |
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 multiprocessing | |
# Turn on debugging in the server. [False] | |
debug=True | |
# Install a trace function that spews every line executed by the server. [False] | |
spew=False | |
# The Access log file to write to. [None] | |
#accesslog='/var/log/gunicorn.access.log' |