Skip to content

Instantly share code, notes, and snippets.

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

Atsuo Fukaya fukayatsu

🏠
Working from home
View GitHub Profile
@uasi
uasi / gist:214109
Last active September 11, 2015 03:06
Show branch name in Zsh's right prompt
#
# 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
@rubiojr
rubiojr / mr_status_bar_app.rb
Created November 30, 2009 11:47
MacRuby StatusBar Application
#
# 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:'
@vvalgis
vvalgis / Capistrano tasks for starting unicorn.rb
Created May 7, 2010 08:13
Capistrano tasks for starting unicorn
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
@hryk
hryk / glitch.rb
Created May 10, 2011 11:13
glitch your display.
#!/usr/bin/env macruby
#
# MacRubyで画面グリッチをフルスクリーン表示する
#
# http://twitter.com/negipo/status/67572370247913473
#
# ## Usage
#
# ./glitch.rb
#
@fumokmm
fumokmm / twitter4jtext.groovy
Created September 3, 2011 08:11
Groovyでtwitter4jを使ってpostするサンプル
// 参考: 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')
@btoone
btoone / curl.md
Last active May 14, 2024 19:32
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@rcorreia
rcorreia / drag_and_drop_helper.js
Last active August 11, 2023 06:41
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
@telent
telent / polar.rb
Created April 26, 2012 15:35
Interface with a polar bluetooth hrm from ruby (linux)
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)
@jugyo
jugyo / sublime_text_2_plugin_tips.md
Created August 13, 2012 09:54
Sublime Text 2 Plugin Tips

Sublime Text 2 Plugin Tips

API Reference

コマンドの実行はコンソール( ctrl + ` で開ける)で以下を実行する:

view.run_command('example')