An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# | |
# Show branch name in Zsh's right prompt | |
# | |
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null | |
setopt prompt_subst | |
function rprompt-git-current-branch { | |
local name st color gitdir action |
# | |
# Initialize the stuff | |
# | |
# We build the status bar item menu | |
def setupMenu | |
menu = NSMenu.new | |
menu.initWithTitle 'FooApp' | |
mi = NSMenuItem.new | |
mi.title = 'Hellow from MacRuby!' | |
mi.action = 'sayHello:' |
set :rails_env, :production | |
set :unicorn_binary, "/usr/bin/unicorn" | |
set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do |
#!/bin/sh | |
screencapture -m -tjpg ~/tmp/capture.jpg | |
cat ~/tmp/capture.jpg | perl -npe 's/0/9/g' >~/tmp/glitched_capture.jpg | |
open /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app # set qtz file shows ~/tmp/glitched_capture.jpg |
#!/usr/bin/env macruby | |
# | |
# MacRubyで画面グリッチをフルスクリーン表示する | |
# | |
# http://twitter.com/negipo/status/67572370247913473 | |
# | |
# ## Usage | |
# | |
# ./glitch.rb | |
# |
// 参考: http://d.hatena.ne.jp/irof/20110625/p1 | |
// http://twitter4j.org/ja/code-examples.html | |
@Grab('org.twitter4j:twitter4j-core:latest.integrated') | |
import twitter4j.* | |
import twitter4j.conf.* | |
def conf = new ConfigurationBuilder() | |
.setOAuthConsumerKey('consumer key') | |
.setOAuthConsumerSecret('consumer secret') |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
(function( $ ) { | |
$.fn.simulateDragDrop = function(options) { | |
return this.each(function() { | |
new $.simulateDragDrop(this, options); | |
}); | |
}; | |
$.simulateDragDrop = function(elem, options) { | |
this.options = options; | |
this.simulateEvent(elem, options); | |
}; |
require 'pp' | |
require 'socket' | |
module BluetoothPolarHrm | |
AF_BLUETOOTH=31 # these are correct for the Linux Bluez stack | |
BTPROTO_RFCOMM=3 | |
class << self | |
def connect_bt address_str,channel=1 | |
bytes=address_str.split(/:/).map {|x| x.to_i(16) } | |
s=Socket.new(AF_BLUETOOTH, :STREAM, BTPROTO_RFCOMM) |
コマンドの実行はコンソール( ctrl + ` で開ける)で以下を実行する:
view.run_command('example')