いかにしておっぱい画像をダウンロードするか〜2012 - ゆーすけべー日記
これを Ruby でそのまま実装してみた
git clone git://gist.github.com/1937292.git oppai # この Gist をコピー
cd oppai
bundle install # Bundler で依存ライブラリをインストール
// 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; |
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" : |
いかにしておっぱい画像をダウンロードするか〜2012 - ゆーすけべー日記
これを Ruby でそのまま実装してみた
git clone git://gist.github.com/1937292.git oppai # この Gist をコピー
cd oppai
bundle install # Bundler で依存ライブラリをインストール
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] というものがよく使われてた
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__) |
// 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!" |
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]) |
# 少し凝った zshrc | |
# License : MIT | |
# http://mollifier.mit-license.org/ | |
######################################## | |
# 環境変数 | |
export LANG=ja_JP.UTF-8 | |
# 色を使用出来るようにする |