Skip to content

Instantly share code, notes, and snippets.

View ne-sachirou's full-sized avatar

さっちゃん ne-sachirou

View GitHub Profile
@defunkt
defunkt / installing-mustache.vim.md
Created March 6, 2010 10:21
Installing mustache.vim

mustache.vim

In your shell:

cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/

rm -rf mustache.vim

@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@mirakui
mirakui / make_token.rb
Created May 3, 2010 13:05
To get twitter/oauth access token
require 'twitter_oauth'
print 'Consumer Key> '
consumer_key = gets.chomp
print 'Consumer Secret> '
consumer_secret = gets.chomp
t = TwitterOAuth::Client.new(
:consumer_key => consumer_key,
@gotwalt
gotwalt / gist:528586
Created August 17, 2010 05:33
Posting to twitpic in Ruby using oauth echo
require "nestful"
require "roauth"
def upload(path_to_file)
twitpic_key = "my_twitpic_api_key"
oauth_url = "https://api.twitter.com/1/account/verify_credentials.json"
oauth = {
:access_key => "account_access_key",
:access_secret => "account_access_secret",
javascript:(function(){
var hintkeys = 'asdfghjkl';
function createText(num) {
var text = '', l = hintkeys.length, iter = 0;
while (num >= 0) {
var n = num;
num -= Math.pow(l, 1 + iter++);
}
for (var i = 0; i < iter; i++) {
r = n % l;
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
// オレオレ性能測定
#include "xor128.hpp"
// ローパスフィルタ
// 結果のランダムな性質を少し和らげて、より正確な処理ができるよう(気休めレベルですが)
struct LPF
{
typedef double result_type;
explicit LPF( double x0 = 0 )
: x_(x0), y_(x0) {}
@tmyt
tmyt / gist:768160
Created January 6, 2011 17:00
Azurea Script Sample
/*
選択されたユーザのホームからPost数を探してきて表示してみる API版(Require API Level:5-)
*/
System.addContextMenuHandler('Get tweets count', 0, function(id){
var st = TwitterService.status.get(id);
var xml = TwitterService.call('/users/show/' + st.user.screen_name + '.xml');
if(xml.match('<statuses_count>(\\d+)</statuses_count>')){
System.showNotice("@" + st.user.screen_name + "'s total tweets: " + RegExp.$1);
}
});
@monjudoh
monjudoh / underscore.interval-iterator.js
Created February 7, 2011 07:54
長時間かかる反復メソッド(each,map,reduce等)の実行をtimerで飛ばしながら休み休み行うUnderscore.js用mixin
/*
* Underscore.js plugin
* http://documentcloud.github.com/underscore/
*/
(function(){
var root = this;
var console = root.console;
var optionsTable = {};
var setResultTable = {};
var lib = {};
@tmyt
tmyt / gist:836895
Created February 21, 2011 10:17
Azurea ColorLabel Preview support script
/*
Azurea 1.3.2.ColorLabelPreviewを利用してカラーラベルを利用するためのサポートスクリプト
ColorLabelPreviewとセットで使用してください。
http://refy.net/temp/Azurea.1.3.2.ColorLabelPreview.1.i386.exe
http://refy.net/temp/Azurea.1.3.2.ColorLabelPreview.1.ARMv5T.exe
使用方法
Scripts\以下に任意のファイル名で保存
テキストエリアからsetcolor(screen_name,colorcode)とPostする
screen_nameはカラーラベルを設定したいユーザのスクリーンネーム、