Skip to content

Instantly share code, notes, and snippets.

View jugyo's full-sized avatar
🏠
Working from home

Kaz jugyo

🏠
Working from home
  • The League
  • New Jersey
View GitHub Profile
↑のStar押してみて!
@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",
@mzp
mzp / echo.html
Created December 11, 2010 01:30
websocket.py
<html>
<head>
<style type="text/css">
.log {
color: red;
}
</style>
<script>
ws = new WebSocket("ws://localhost:8080");
ws.onopen = function (e) {
require 'ruby-debug'
require 'socket'
require 'forwardable'
class SporkDebugger
DEFAULT_PORT = 10_123
HOST = '127.0.0.1'
extend Forwardable
def_delegators :state, *[:prepare_debugger, :initialize]
@mbulat
mbulat / gist:892544
Created March 29, 2011 15:21
Earthquake plugin to open a link in a tweet
# Pass in a tweet id to open a link in the text
#
# :open $xx
Earthquake.init do
command %r|^:open\s+([^\/\s]+)$|, :as => :open do |m|
twitter.status(m[1]).tap do |s|
if s["text"]
link_match = s["text"].match(/(https?:\/\/\S*)/)
if link_match
Launchy.open(link_match[0])
#!/usr/bin/env node
//http://vimeo.com/22429969
var fs = require('fs');
var spawn = require('child_process').spawn;
var cap = "/path/to/cap.jpg";
var glt = "/path/to/cap_glitch.jpg";
##earthquake.ge plugin
##post url to instapaper.com
Earthquake.init do
_ = config[:instapaper] ||= {}
_[:user] ||= ''
_[:password] ||= ''
command :instapaper do |m|
tweet = twitter.status(m[1])["text"]
# -*- coding: utf-8 -*-
#earthquake.gem plugin
#javascript via phantomjs
require 'tempfile'
def do_bmklt(js,url)
tmp = Tempfile.new("tmpjs")
begin
tmp.puts js
@victusfate
victusfate / Gemfile
Created May 10, 2011 00:06 — forked from dodeja/Gemfile
Rails 3.1 Beta 1 on Heroku Working Config
# source 'http://rubygems.org'
source :gemcutter
gem 'rails', '3.1.0.beta1'
# Asset template engines
gem 'json'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
@ayumin
ayumin / build_ruby.sh
Created April 30, 2012 14:44
Ruby compile option (Mac OSX)
#!/usr/bin/sh
make realclean
autoconf
./configure --prefix=~/tmp/ruby-trunk \
--with-gcc=gcc-4.2 \
--with-arch=x86_64 \
--with-readline-dir=/usr/local \