Skip to content

Instantly share code, notes, and snippets.

View mov_timestamp.rb
#! /usr/bin/ruby
require 'time'
ATOM_HEADER_SIZE = 8
# difference between Unix epoch and QuickTime epoch, in seconds
EPOCH_ADJUSTER = 2082844800
def get_creation_time(fname)
ctime = `GetFileInfo -d '#{fname}'`.strip
@webos-goodies
webos-goodies / flexcopy.rb
Created June 20, 2012 06:59
Copy multiple files and directories with timestamp checking and exclude patterns.
View flexcopy.rb
#! /usr/bin/ruby
require 'optparse'
require 'fileutils'
$verbose_mode = false
$update_mode = false
$exclude_patterns = []
$exclude_suffixes = []
$files = []
@webos-goodies
webos-goodies / gist:1651682
Created January 21, 2012 06:20
Enables high-replication datastore on Kay framework's testing framework
View gist:1651682
from kay.ext.testutils.gae_test_base import GAETestBase
from google.appengine.api import apiproxy_stub_map
from google.appengine.datastore import datastore_stub_util
class TestSuite(GAETestBase):
def setUp(self):
stub = apiproxy_stub_map.apiproxy.GetStub('datastore_v3')
stub.SetConsistencyPolicy(
datastore_stub_util.TimeBasedHRConsistencyPolicy())
@webos-goodies
webos-goodies / MaximizeImg.js
Created April 20, 2011 06:41
UserJS to maximize image by double-click on Opera
View MaximizeImg.js
// ==UserScript==
// @description maximize image by double-click instead of auto resizing.
// @author Chihiro Ito
// ==/UserScript==
if(document.querySelector("head>link[rel='stylesheet'][href='opera:style/image.css']")) {
window.donotrun=true;
document.body.style='margin:0; padding:0;';
var img = document.getElementsByTagName('img')[0];
if(img) {