Skip to content

Instantly share code, notes, and snippets.

View tmd45's full-sized avatar

Yoko TAMADA tmd45

View GitHub Profile
@ojimac
ojimac / run.php
Created July 19, 2012 13:51
フォローされている人をフォローするスクリプト
<?php
error_reporting(-1);
set_time_limit(0);
require_once "./twitteroauth/twitteroauth/twitteroauth.php";
$twitter = new TwitterOAuth(
{Consumer key},
{Consumer secret},
{Access token},
{Access token secret}
@monjudoh
monjudoh / fizzbuzz.js
Created August 7, 2012 05:28
FizzBuzzを久々に素直に書いたら長くなった
Array.apply(null,new Array(101))
.map(function(n,i){ return '';})
.map(function(n,i){ return n+(i % 3 ? '' : 'Fizz');})
.map(function(n,i){ return n+(i % 5 ? '' : 'Buzz');})
.map(function(n,i){ return n ? n : i;})
.slice(1,101)
@yuroyoro
yuroyoro / ScalazFizzBuzz.scala
Created August 8, 2012 04:42
ScalazでFizzBuzz
import scalaz._,Scalaz._
val fizzbuzz = (x:Int) => (Enum[Int].from(0) map {n => ((n%3 === 0).option("Fizz") |+| (n%5 === 0).option("Buzz")) <+> n.shows.pure[Option]} take x+1 flatten).foreach(println)
" カーソル下のgemのrdocを開く
function! OpenYard(...)
let gem = a:1 == "" ? "" : a:1
if gem == ""
call OpenBrowser("http://localhost:8808/")
else
let url = "http://localhost:8808/docs/" . tolower(gem) . "/frames/"
call OpenBrowser(url)
endif
endfunction
@akira1908jp
akira1908jp / fuelphptokyo_vol_2.html
Created September 23, 2012 05:29
FuelPHP 勉強会 vol.2
2012/09/23 FuelPHP勉強会 vol.2に参加してきた。
http://atnd.org/events/31917
○GtとGitHubについて
・分散型と集中型
・オーガニゼーション
github
@hitode909
hitode909 / access_log.webtailrc.js
Created October 31, 2012 10:13
webtailでアクセスログ聞くやつ
if (!context.setup) {
context.setup = true;
var app = {
counts: {
GET: 0,
POST: 0,
},
$log: $('<pre>').appendTo($(document.body)),
urls: [],
@noromanba
noromanba / hatenaspace-its-suggestion.mkd
Last active December 18, 2015 22:09
frequently asked issue and ITS suggestion for HatenaSpace (ja)
@ogasyo
ogasyo / legacy_mem_cache_store.rb
Created August 2, 2013 08:49
Rails4 で dalli が標準の MemcacheClient になっちゃった対策。
# Add legacy memcache session store for using KyotoTycoon with memcached protocol.
# Sourced from Rails 3.2
# => https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb
#
require 'action_dispatch/middleware/session/abstract_store'
require 'rack/session/memcache'
module ActionDispatch
module Session
class LegacyMemCacheStore < Rack::Session::Memcache
@a-suenami
a-suenami / 糖質制限アンチパターン.md
Last active February 5, 2016 05:51
糖質制限アンチパターン 2015 の 2 日目のエントリです。

このエントリは糖質制限 Advent Calendar の 2 日目のエントリです。前日は @chiastolite さんの「半年の糖質制限生活の経過報告的なにか」でした。

お前誰?

a_suenami と申します。ネット界隈では「糖質警察」として多少知られてると思います。よろしくお願いします。 僕の糖質制限への熱い想いはこのへんを見ていただければわかるかと思います。

糖質とプログラミングと私

今日のテーマ

data Vector a = Vector a a a deriving (Show)
vplus :: (Num a) => Vector a -> Vector a -> Vector a
(Vector i j k) `vplus` (Vector l m n) = Vector (i+l) (j+m) (k+n)
dotProd :: (Num a) => Vector a -> Vector a -> a
(Vector i j k) `dotProd` (Vector l m n) = i*l + j*m + k*n
vmult :: (Num a) => Vector a -> a -> Vector a
(Vector i j k) `vmult` m = Vector (i*m) (j*m) (j*m)