Skip to content

Instantly share code, notes, and snippets.

View wozozo's full-sized avatar
😇
Hello

Yoichi Fujimoto wozozo

😇
Hello
  • Tokyo, Japan
  • 19:24 (UTC +09:00)
  • X @wozozo
View GitHub Profile
@bellbind
bellbind / getscreenshot.py
Created June 29, 2009 15:50
[python][pywebkitgtk]Get web page screenshot
#
# Get web page screenshot
#
# usage:
# xvfb-run -s "-screen 0 1024x768x24" python getschreenshot.py test.html
#
# libs:
# - pygtk: http://www.pygtk.org/
# - pywebkitgtk(python-webkit): http://code.google.com/p/pywebkitgtk/
# - PIL: http://www.pythonware.com/products/pil/
#!/bin/sh
# vim で、特定ファイル全部を、確認しながら置換する
# http://subtech.g.hatena.ne.jp/cho45/20100405/1270444967
# をシェルスクリプトにしてみた。
# $ replace-confirn /Foo/Bar/ *.txt のようにして使う。
# (変な引数を渡すと当然変な結果になるので注意)
# コマンドが起動するとvimが開き、パターンにマッチする部分がハイライト表示されるので
# そのまま置換するときはy、置換せずに次のマッチに飛ぶときはnをタイプする。
# すべてのファイルを表示し終わると普通のvimのコマンドモードになるので:qをタイプして終了する。
git clone https://github.com/symfony/symfony-bootstrapper.git
mkdir -p symfony-bootstrapper/src/vendor
cd symfony-bootstrapper/src/vendor
git clone git://github.com/symfony/symfony.git symfony
git clone git://github.com/doctrine/doctrine2.git doctrine
git clone git://github.com/doctrine/data-fixtures doctrine-data-fixtures
git clone git://github.com/doctrine/dbal.git doctrine-dbal
git clone git://github.com/doctrine/common.git doctrine-common
@yoshuki
yoshuki / instagram_backup.rb
Created January 21, 2011 17:53
Backup Instagram photos.
require 'fileutils'
require 'net/http'
require 'instagram'
USER_ID = # Your id as integer.
def main
photos = Instagram::by_user(USER_ID)
photos.each do |photo|
@juno
juno / github-api-practice.rb
Created January 22, 2011 12:49
w/HTTParty
require 'json'
require 'httparty'
class Github
include HTTParty
base_uri 'http://github.com/api/v2/json'
# @param [String] username GitHub username
# @param [String] password Password or API token
def initialize(username, password)
@jupiterjs
jupiterjs / JavaScriptMVC.md
Created May 24, 2011 16:58 — forked from moschel/JavaScriptMVC.md
JavaScriptMVC Overview

The following is a VERY rough draft of an article I am working on for Alex MacCaw's @maccman's Book. It is very rough, but even now a worthwhile read. Suggestions / comments are very welcome! Please help me :-)

Introduction

JavaScriptMVC (JMVC) is an open-source jQuery-based JavaScript framework. It is nearly a comprehensive (holistic) front-end development framework, packaging utilities for testing, dependency management, documentation, and a host of useful jQuery plugins.

Yet every part of JavaScriptMVC can be used without every other part, making the library lightweight. Its Class, Model, View, and Controller combined are only 7k minified and compressed, yet even they can be used independently. JavaScriptMVC's independence lets you start small and scale to meet the challenges of the most complex applications on the web.

This chapter covers only JavaScriptMVC's $.Class, $.Model, $.View, and $.Controller. The following describes each component:

@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@kkung
kkung / app.py
Created May 27, 2011 09:34
Flask, session store in memcached
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash
from werkzeug.contrib.sessions import Session, SessionStore
from cPickle import HIGHEST_PROTOCOL
from random import random
from flask import json
class MemcachedSessionStore(SessionStore):
def __init__(self, servers=None, key_prefix=None, default_timeout=300):
@syoichi
syoichi / gyazocom_redirect_to_ima.user.js
Created June 19, 2011 00:36 — forked from youpy/gyazocom_redirect_to_ima.user.js
gyazo.comの画像にアクセスすると広告ページへリダイレクトするようになっていたので、cache.gyazo.comの画像にリダイレクトするように修正した。
// ==UserScript==
// @name Gyazo.com: Redirect to image
// @namespace http://buycheapviagraonlinenow.com/
// @include http://gyazo.com/*
// @include http://cache.gyazo.com/*
// @author youpy
// @compatibility Firefox 5.0(Scriptish 0.1.3), Chrome 12.0.742.122, Safari 5.0.5(NinjaKit 0.8), Opera 11.50 on Windows 7 Enterprise 32bit
// @charset UTF-8
// @version 0.0.3.20110715134929
// ==/UserScript==
@gwik
gwik / geventmongo.py
Created August 31, 2011 18:17
PyMongo >=2.0 pool for gevent
# Copyright 2011 10gen
#
# Modified by Antonin Amand <antonin.amand@gmail.com> to work with gevent.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#