Skip to content

Instantly share code, notes, and snippets.

View giginet's full-sized avatar
🌴
年中On vacation

Kohki Miki giginet

🌴
年中On vacation
View GitHub Profile
require 'rubygems'
require 'mechanize'
require 'rss'
require 'yaml'
require 'open-uri'
######################
#HBtomixi Ver1.0
#はてなダイアリの記事とmixiを同期させます。
#詳細や使い方など:
#コードの改変、再配布は出典明記の上可
@giginet
giginet / iPhoneSoundConverter.py
Created June 25, 2011 01:02
iPhoneSoundConverter.py
import os
import sys
path = sys.argv[1] if len(sys.argv) >= 2 else os.getcwd()
os.chdir(path)
for file in os.listdir(path):
filename, ext = os.path.splitext(file)
if ext in ('.wav', '.mp3', '.aif'):
os.system('/usr/bin/afconvert -f caff -d LEI16 %s %s.caf' % (file, filename))
print 'create %s.caf' % filename
@giginet
giginet / test
Created September 27, 2011 06:31
testtest
@giginet
giginet / buildenv.sh
Created October 8, 2011 10:10 — forked from lambdalisue/buildenv.sh
Build python develop environment via pythonbrew
#!/bin/bash
PLATFORM=`uname`
PYTHON_VERSION=2.7.2
if [ "$PLATFORM" = 'Linux' ]; then
echo "Installing required packages..."
yes | sudo apt-get install curl python-all-dev python3-all-dev
yes | sudo apt-get install libreadline6-dev libsqlite3-dev libgdbm-dev
yes | sudo apt-get install libbz2-dev build-essential libxml2-dev libxslt1-dev
# Patch for PIL
@giginet
giginet / hatena.py
Created October 8, 2011 19:04
django-social-oauth Hatena auth backend
# -*- coding: utf-8 -*-
"""
Hatena OpenID support
This is a custom backend for django-social-auth. This adds support for Hatena oauth service.
An application must be registered first on hatena and the settings HATENA_CONSUMER_KEY
and HATENA_CONSUMER_SECRET must be defined in your settings.py.
ref : http://developer.hatena.ne.jp/ja/documents/auth/apis/oauth/consumer
"""
__author__ = 'giginet'
brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi
curl -O http://pygame.org/ftp/pygame-1.9.1release.tar.gz
tar xfz pygame-1.9.1release.tar.gz
curl -O https://raw.github.com/gist/1150088
patch -p0 < 1150088
cd pygame-1.9.1release
python setup.py build
python setup.py install
(console.log "#{i}月はCoffeeScriptで酒が飲めるぞー酒が飲めるぞー" for i in [1..12])
for(i in 1:12){
print(paste(i, "月はRで酒が飲めるぞー酒が飲めるぞー"))
}
Array.prototype._index=function(a){var b;if(a<0){b=this.length;return b+a}return a};Array.prototype.at=function(a){return this[this._index(a)]};Array.prototype.map=function(a){var c,b;return([].splice.apply(this,[0,this.length-0].concat(b=(function(){var f,e,d;d=[];for(f=0,e=this.length;f<e;f++){c=this[f];d.push(a(c))}return d}).call(this))),b)};Array.prototype.clone=function(){return this.dup()};Array.prototype.dup=function(){return this.slice(0,this.length)};Array.prototype.each=function(b){var a,c;for(a=0,c=this.length;0<=c?a<c:a>c;0<=c?a++:a--){b(this[a],a)}return this};Array.prototype.deleteAt=function(a){a=this._index(a);if(a>=this.length){return}return this.splice(a,1)};Array.prototype.deleteIf=function(b){var a;return this.replace((function(){var d,c;c=[];for(a=0,d=this.length;0<=d?a<d:a>d;0<=d?a++:a--){if(!b(this[a],a)){c.push(this[a])}}return c}).call(this))};Array.prototype.reject=function(a){var b;b=this.length;this.deleteIf(a);if(b===this.length){return}return this};Array.prototype.isEmpty=functi
@giginet
giginet / pov.vim
Created November 22, 2011 04:43
Render and open POVRay file on quickrun.vim
let g:quickrun_config.pov = {
\ 'command' : 'povray',
\ 'exec' : ['%c +FN +W640 +H480 +A %s', 'open %s:r.png'],
\ 'split': '{"rightbelow 10sp"}'
\}