Skip to content

Instantly share code, notes, and snippets.

View torufurukawa's full-sized avatar

Toru Furukawa torufurukawa

View GitHub Profile
@torufurukawa
torufurukawa / gist:6161212
Last active December 20, 2015 16:28
angularjs service creation
angular.module('feiz', [], function($provide) {
$provide.factory('get', ['$http', function(http) {
return function(scope) {
http({url:'http://oldriver.org/index.html', method:'GET'}).
error(function(){
scope.hoge = "azuma";
});
};
}]);
});
"""Provides patch for backloglib to work on Google App Engine
Usage:
>>> import backloglib
>>> import gaebackloglib
>>> gaebackloglib.patch(backloglib)
"""
import sys
import xmlrpclib
@torufurukawa
torufurukawa / Makefile
Last active January 1, 2016 23:09
俺のブートストラップ
.PHONY : all venv py-packages
VENV_DIR = venv
BIN_DIR = $(VENV_DIR)/bin
BASE_PYTHON = python3.4
PIP = $(BIN_DIR)/pip
ACTIVATE = $(BIN_DIR)/activate
PYTHON = $(BIN_DIR)/python
PIP_REQUIREMENTS = pip-requirements.txt
# default virtualenv
export VIRTUAL_ENV_DISABLE_PROMPT=1; source ~/.virtualenvs/default/bin/activate
unset VIRTUAL_ENV_DISABLE_PROMPT
[color]
ui = auto
[alias]
glog = log --graph --date=short --decorate=short --pretty=format:'%h %Cblue%d%Creset %cd %cn %s'
st = status
@torufurukawa
torufurukawa / keymap.cson
Created November 18, 2016 00:12
Atom keymap settings
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
"""requests wrapper
>>> import curledrequests as requests
you can use this as requests module, but...
>>> requests.debug = True
>>> requests.get('http://example.com/')
curl http://example.com/
Hello
package main
import (
"fmt"
)
func main() {
in1 := make(chan int)
in2 := make(chan string)
done := make(chan bool)
package main
import (
"fmt"
"math/rand"
)
func main() {
var p Point = Point{2, 3}
var q Quality = Quality{99.9}
@torufurukawa
torufurukawa / keybindings.json
Created February 4, 2017 11:54
VS Code key bindings
// 既定値を上書きするには、このファイル内にキー バインドを挿入します
[
// Moving cursor
{ "key": "ctrl+p", "command": "cursorUp",
"when": "editorTextFocus" },
{ "key": "ctrl+n", "command": "cursorDown",
"when": "editorTextFocus" },
{ "key": "ctrl+f", "command": "cursorRight",
"when": "editorTextFocus"},
{ "key": "ctrl+b", "command": "cursorLeft",