Skip to content

Instantly share code, notes, and snippets.

View key's full-sized avatar

Mitsukuni Sato key

View GitHub Profile
#!/bin/sh
#
# Copyright (c) 2010 Shinnosuke Suzuki <sasasin@sasasin.net>
# You can distribute this file under the GPL.
#
# Modified by TADA Tadashi <t@tdtds.jp>
#
FILE=$1
if [ -z $FILE ]; then
echo usage: pdf2kindle PDFfile [top bottom left right]
@kiowa
kiowa / fakesouth.py
Created April 12, 2011 15:46
A fake south database support file.
"""
Nice fake South database driver in case you are mixing supported/unsupported databases.
Usage: Update your settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydb',
'USER': 'mydb',
#!/bin/sh
export LANG=C
testURLContentsChange()
{
sysctl xen.independent_wallclock=1
TEST_URL="http://www.example.com/"
TODAY_START_DATE=`date +'%Y-%m-%d 00:00:00'`
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

import struct
import zlib
import itertools
class bitstream(object):
def __init__(self, buf):
self.buf = buf
self.i = 0
self.rem = 0
self.n = 0
@basuke
basuke / drive.py
Created September 2, 2012 22:49
Create the GPX file from origin and destination using the GoogleMap Direction API. You can use this output for simulate the location apps in Xcode.
#
# python drive.py "origin" ["waypoint" ... ] "destination"
#
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO
import sys, json, urllib2, md5, os.path, pprint
from math import radians, sin, cos, atan2, pow, sqrt
from urllib import quote_plus
from xml.sax.saxutils import escape
from optparse import OptionParser
@mmdumi
mmdumi / EncodePolyline
Created November 2, 2012 09:09
Encode polyline. Google Maps API v3 algorithm. Objective c.
+ (NSString *)encodeStringWithCoordinates:(NSArray *)coordinates
{
NSMutableString *encodedString = [NSMutableString string];
int val = 0;
int value = 0;
CLLocationCoordinate2D prevCoordinate = CLLocationCoordinate2DMake(0, 0);
for (NSValue *coordinateValue in coordinates) {
CLLocationCoordinate2D coordinate = [coordinateValue MKCoordinateValue];
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@kozy4324
kozy4324 / shared_serverspec.md
Last active December 19, 2015 19:29
serverspecをshared_examplesを使ってRole毎のspecを分けてみる

serverspecをshared_examplesを使ってRole毎のspecを分けてみる

spec/_role以下にspecファイルを分離してみた.

$ tree spec/
spec/
├── _role
│   ├── cloudforecast_spec.rb
│   ├── growthforecast_spec.rb
@exoego
exoego / 転職先に訊きたいチェックリスト.md
Last active April 16, 2023 03:57
転職活動してて訊きたいことのメモ

制度

  • 有休…
  • 病休…
  • 育休…
  • 年収(月給、賞与など)…
  • 残業代…
  • 早朝/深夜手当…
  • 休出手当…
  • 住宅補助…