Skip to content

Instantly share code, notes, and snippets.

View seiichi's full-sized avatar

Seiichi SATO seiichi

  • Fukuoka, Japan
View GitHub Profile
@seiichi
seiichi / import-DEVNULL.py
Created September 17, 2013 02:40
handling subprocess.DEVNULL under both python2 and python3 (taken from youtube-dl)
try:
from subprocess import DEVNULL
compat_subprocess_get_DEVNULL = lambda: DEVNULL
except ImportError:
compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w')
@seiichi
seiichi / gist:5696607
Last active December 18, 2015 00:29
同僚向け
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('maps', '3', {'other_params': 'sensor=true'});
(function($) { 'use strict';
$(document).ready(function() {
var latlng = new google.maps.LatLng(33.59135, 130.408334);
var opts = {
center: latlng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
@seiichi
seiichi / gist:5696589
Created June 3, 2013 07:29
同僚向け
(function($) {
$(document).ready(function() {
// your code
});
})(jQuery);
@seiichi
seiichi / db.php
Created November 25, 2012 04:30
getting sqlite to work with fuelphp
// works with FuelPHP 1.4
return array(
'default' => array(
'type' => 'pdo',
'connection' => array(
'dsn' => 'sqlite:/PATH/TO/DATABASE_FILE',
'username' => '',
'password' => '',
),
'charset' => NULL, /* http://stackoverflow.com/questions/263056/how-to-change-character-encoding-of-a-pdo-sqlite-connection-in-php */