Skip to content

Instantly share code, notes, and snippets.

View YuheiNakasaka's full-sized avatar
💭
😇

razokulover YuheiNakasaka

💭
😇
View GitHub Profile
@astronaughts
astronaughts / app.js
Created December 19, 2011 15:14
Baruth vol.1
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow();
win.hideTabBar();
win.navBarHidden = true;
var tab = Titanium.UI.createTab({window: win});
var Z_INDEX_TOP = 3;
var Z_INDEX_BOTTOM = 0;
@Pentan
Pentan / mpo2jpgs.py
Created January 24, 2012 09:38
split MPO format file (like a 3DS's stereo 3D picture) to individual JPG images.
import sys
import os
from struct import unpack
def splitMPO( mpof ):
filename = mpof.name
#print "MPO input: {}".format(filename)
#check SOI
soi = mpof.read(2)
if soi != "\xff\xd8" :
@rummelonp
rummelonp / 0-oppai.md
Created February 29, 2012 03:14
いかにしておっぱい画像をダウンロードするか〜2012 for Ruby
@rummelonp
rummelonp / faraday.md
Last active May 20, 2022 12:23
Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた

[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた

@gorenje
gorenje / Gemfile
Created June 8, 2012 11:05 — forked from fairchild/Gemfile
An example sinatra omniauth client app
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@katryo
katryo / quick_sort.rb
Created September 8, 2012 13:23
Rubyでのクイックソート
def quicksort(seq)
if seq.size == 0
return seq
end
pivot = seq[0]
right = Array.new
left = Array.new
for i in 1..seq.size-1
if seq[i] <= pivot
left.push(seq[i])
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@mochiz
mochiz / gist:4736183
Last active April 16, 2023 03:56
rbenvとruby-buildでRuby環境を最新に保つ

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
@mollifier
mollifier / zshrc_useful.sh
Last active July 8, 2024 09:22
少し凝った zshrc
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする