Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dear gist: are you slow today? | |
testing | |
foobar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def singularize(word): | |
"""Return the singular form of a word | |
>>> singularize('rabbits') | |
'rabbit' | |
>>> singularize('potatoes') | |
'potato' | |
>>> singularize('leaves') | |
'leaf' | |
>>> singularize('knives') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
duration,time,difference | |
1,20.367,3.367 | |
2,23.967,3.600 | |
3,27.167,3.200 | |
4,32.833,5.666 | |
5,37.933,5.100 | |
6,40.333,2.400 | |
7,42.600,2.267 | |
8,45.767,3.167 | |
9,47.333,1.566 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# implementation | |
module Merb::Cache::CacheMixin | |
def fetch_partial(template, opts={}, conditions = {}) | |
template_id = template.to_s | |
if template_id =~ %r{^/} | |
template_path = File.dirname(template_id) / "_#{File.basename(template_id)}" | |
else | |
kontroller = (m = template_id.match(/.*(?=\/)/)) ? m[0] : controller_name | |
template_id = "_#{File.basename(template_id)}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This version works | |
$('#account_info_form').submit(function() { | |
$.facebox(function() { | |
$("#account_info_form").ajaxSubmit(function(respText, statusText) { | |
$.facebox((statusText == "success")?"Account Information successfully update": | |
"Failed to update Account Information."); | |
}) | |
}); | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" fudemame.py | |
マイミクの日記更新頻度を調べる | |
""" | |
import datetime | |
import pickle | |
import mymixi_diary | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inside Rakefile | |
unless ARGV.any? && ARGV[0][0..3] == 'dm:' | |
Kernel.send(:undef_method, :repository) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Loveno_AdminRest_ProductController extends Mage_Adminhtml_Controller_Action { | |
public function preDispatch() { | |
parent::preDispatch(); | |
$session = Mage::getSingleton('admin/session'); | |
$request = $this->getRequest(); | |
$user = $session->getUser(); | |
if (!$user) { | |
//var_dump('no login'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name wassr-https-hack | |
// @description wassr.{jp|com} is not yet fully applies https | |
// @include http://wassr.com/* | |
// @include http://wassr.jp/* | |
// @include https://wassr.com/* | |
// @include https://wassr.jp/* | |
// @namespace http://slashdot.jp/~umq/ | |
// @version 1.1 | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select zvn.nr | |
,zvp.datum_ingang | |
,zvp.datum_einde | |
,zvn.soort_voornemen | |
,zvp.status | |
,zvn.r_cli_rel_nr | |
,elv.code | |
,elv.oms | |
from geb_voornemen_elementen vot | |
inner join ref_elementaire_verg_elementen elv |