Skip to content

Instantly share code, notes, and snippets.

↑のStar押してみて!
@zh
zh / em_stream.rb
Created March 18, 2011 03:53
Working with twitter stream (eventmachine)
require 'rubygems'
require 'em-http'
require 'json'
EM.run {
username = 'tw_user'
password = 'tw_password'
buffer = ""
http = EventMachine::HttpRequest.new('http://stream.twitter.com/1/statuses/filter.json').post({
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 8bdf086..fbe0e7d 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -194,6 +194,15 @@ class Tempfile < DelegateClass(File)
ObjectSpace.undefine_finalizer(self)
end
+ def mv(destination_path)
+ raise TypeError, "unlinked Tempfile" unless self.path
" based on vimclojure/syntax/clojure.vim
"
function! s:paren()
if get(b:, 'rainbowParen', 0) == 1
return
endif
syn match rainbowParenError "]\|}\|)"
syn region rainbowParenLevel0 matchgroup=rainbowParen0 start="(" matchgroup=rainbowParen0 end=")" contains=rainbowParenLevel1
syn region rainbowParenLevel1 matchgroup=rainbowParen1 start="(" matchgroup=rainbowParen1 end=")" contained contains=rainbowParenLevel2
syn region rainbowParenLevel2 matchgroup=rainbowParen2 start="(" matchgroup=rainbowParen2 end=")" contained contains=rainbowParenLevel3
@jugyo
jugyo / aview.rb
Created March 22, 2012 05:04
aview earthquake.gem plugin
# coding: UTF-8
require 'open-uri'
require 'tmpdir'
Earthquake.init do
command :aview do |m|
if m[1] =~ /^http/
url = m[1]
else
@romaninsh
romaninsh / swapon.service
Created December 1, 2014 10:05
Set up swap on CoreOS
create this file in your /root folder
$ fleetctl load swapon.service
$ fleetctl start swapon.service
This will create swap file on all nodes of your CoreOS cluster without prior setup.
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted
@you21979
you21979 / testnet.js
Created November 10, 2016 13:46
coinomiウォレット救済ツール
const bitcoin = require("bitcoinjs-lib")
const bip39 = require('bip39')
const bip32utils = require('bip32-utils')
const insight = require('insight-cli').RestClient
const bip44_account = (m, BIP44) => m.deriveHardened(BIP44.PURPOSE).deriveHardened(BIP44.COINTYPE).deriveHardened(BIP44.ACCOUNT)
const mnemonic = ""
const seed = bip39.mnemonicToSeed(mnemonic, "")
@guchimon99
guchimon99 / convert-profit-zaif.js
Created December 1, 2017 03:53
利益計算用取引所別スクリプト zaif
var fs = require('fs')
const
PATH_CURRENCY = "path/to/trade_log.csv",
PATH_TOKEN = "path/to/token_trade_log.csv"
var currencyCsv = fs.readFileSync(PATH_CURRENCY, 'utf-8'),
tokenCsv = fs.readFileSync(PATH_TOKEN, 'utf-8')
var result = {}
@guchimon99
guchimon99 / convert-profit-coincheck.js
Created December 1, 2017 03:54
利益計算用取引所別スクリプト coincheck
var fs = require('fs')
const
PATH_SELLS = __dirname + "/../files/coincehck/buys-2017-11-30.csv",
PATH_BUYS = __dirname + "/../files/coincehck/sells-2017-11-30.csv"
var sellsCsv = fs.readFileSync(PATH_SELLS, 'utf-8'),
buysCsv = fs.readFileSync(PATH_BUYS, 'utf-8')
var result = {}
@hyuki0000
hyuki0000 / TipmonaTipBookmarklet.js
Last active January 19, 2018 22:46
TipmonaTipBookmarklet.js - Pay monacoin via @tipmona
/*
* TipmonaTipBookmarklet.js
*
* When you see
* https://twitter.com/EXAMPLEUSER/...
* Then you jump to
* https://twitter.com/intent/tweet?text=@tipmona%20tip%20@EXAMPLEUSER%201%20Mona%20を贈ります。
* And when you see
* https://twitter.com/EXAMPLEUSER/status/xxxxxxxx
* Then you jump to