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 debounce from 'lodash.debounce'; | |
export default function validationDebounceMiddlewareGenerator ({triggerActionTypes, validatorActionType, wait}) { | |
const createValidateActionDebounced = debounce( | |
dispatch => dispatch({type: validatorActionType}), | |
wait | |
); |
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
data = ['aaa', 'bbb', 'ccc', 'aaa', 'ddd'] | |
word_and_counts = {} | |
for word in data: | |
if word_and_counts.has_key(word): | |
word_and_counts[word] += 1 | |
else: | |
word_and_counts[word] = 1 | |
for w, c in sorted(word_and_counts.iteritems(), key=lambda x: x[1], reverse=True): |
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
// require: npm install nib | |
@import 'nib/vendor' | |
support-for-ie = false // disable old browser support | |
topstand-triangle() | |
width: 0 | |
height: 0 | |
border-top: 25px solid bg-color | |
border-left: 20px solid 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
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from guppy import hpy | |
class measure_heap(object): | |
''' | |
メモリ消費量を測定する。 |
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 ns = (function(exports) { | |
var Raise = function constructor() { | |
this._init_handler = function(func) { | |
window.addEventListener('load', func); | |
}; | |
}; | |
Raise.prototype.register = function(id) { | |
var to_top = function(e) { | |
var scroll_top = document.documentElement.scrollTop || document.body.scrollTop; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>aaaa</title> | |
<link rel="stylesheet" href="./css/main.css" type="text/css" media="screen" charset="utf-8"> | |
</head> | |
<body> | |
<input type="text" class="reset_onfocus" placeholder="aaaaaaaaa"> | |
<input type="text" class="reset_onfocus" placeholder="aaaaaaaab"> |
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
func routine(quit chan int) { | |
// do stuff | |
quit <- 1 | |
} | |
func main() { | |
routineQuit := make(chan int) | |
go routine(routineQuit) | |
<-routineQuit // blocks until quit is written to |
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
package main | |
import ( | |
"net" | |
"os" | |
) | |
const ( | |
RECV_BUF_LEN = 1024 | |
) |
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 java.io.IOException | |
import com.leapmotion.leap._ | |
import com.leapmotion.leap.Vector | |
import com.leapmotion.leap.Frame | |
; | |
import com.leapmotion.leap.Gesture.State | |
; |