Skip to content

Instantly share code, notes, and snippets.

@hachibeeDI
hachibeeDI / vbnet.snip
Last active December 10, 2015 00:19
snippet file for neosnippets is plugin of Vim
snippet '''
abbr '''<summary>
''' <summary>${1:#:summary}</summary>
''' <returns>${2:#:returns}</returns>
''' <remarks>${3:#:remarks} </remarks>
''' <history>${4:Created at: `strftime("%Y-%b-%d")`}</history>
${5:#:TARGET}
snippet namespace
$key_codefile = $args[0]
$random = new-Object random
function get_random_word {
$li = 'abcdefghijklmnopqrstuvwxyz'
return $li[$random.next(0, 26)]
}
@hachibeeDI
hachibeeDI / emacs_like.ahk
Created February 15, 2013 04:10
やっつけ仕事
;;
;; An autohotkey script that provides emacs-like keybinding on Windows
;;
#InstallKeybdHook
#UseHook
; Ripped from http://www49.atwiki.jp/ntemacs/pages/20.html
; Thanks a lot!
SetKeyDelay 0
# -*- encoding: UTF-8 -*-
require 'net/http'
require 'uri'
require 'rexml/document'
class Weather
@@signs = {"くもり" => "☁" \
@hachibeeDI
hachibeeDI / file0.txt
Last active June 7, 2019 10:36
Pythonで関数合成と適用的な ref: https://qiita.com/hatchinee/items/ab208f0ce596964c1a31
def compose(f_t_u, f_u_r):
'''
:type f_t_u: t -> u
:type f_u_r: u -> r
:rtype: t -> r
>>> comp(lambda a: a + 'oppai', lambda b: b + 'hoge')('')
'oppaihoge'
>>> comp(comp(lambda a: a+'oppai', lambda b: b+ 'hoge'), lambda x: '[' + x + ']')('')
'[oppaihoge]'
@hachibeeDI
hachibeeDI / Sample.scala
Created August 2, 2013 06:09
とりあえずleapのsampleの単純な置き換えのおいとく
import java.io.IOException
import com.leapmotion.leap._
import com.leapmotion.leap.Vector
import com.leapmotion.leap.Frame
;
import com.leapmotion.leap.Gesture.State
;
@hachibeeDI
hachibeeDI / client.go
Created September 24, 2013 14:16
echo server written by golang
package main
import (
"net"
"os"
)
const (
RECV_BUF_LEN = 1024
)
@hachibeeDI
hachibeeDI / file0.txt
Last active November 1, 2016 13:11
Pythonで単語の数え上げとかするならCounterを使うと便利なはなし ref: http://qiita.com/hatchinee/items/a904c1f8d732a4686c9d
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):
@hachibeeDI
hachibeeDI / go_wait.go
Created October 19, 2013 13:54
pattern of wait for goroutine finished
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
@hachibeeDI
hachibeeDI / index.html
Created December 17, 2013 06:36
フォーカスがあたるとリセットされるinput。何もいじらなければ、直前の内容が保持される。 coffeeと、コンパイル後のjs両方を添付。
<!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">