Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name nifty_cilp_rss_search
// @namespace http://github.com/monmon
// @description googleの検索結果に自分のクリップを入れる
// @include http://www.google.co.jp/*
// ==/UserScript==
(function(){
var user = 'monmon'; // 自分のユーザ名
Activity after 7-25-2008
Results for Felix Geisendörfer:
# of commits : 23
# of lines committed: 4050
Results for Tim Koschützki:
# of commits : 3
# of lines committed: 3764
Felix Geisendörfer wins in commit count with 23 commits!
<?php
class CommunitiesController extends AppController{
/**
* undocumented function
*
* @return void
* @access public
*/
function index() {
$communities = $this->Community->find('all');
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Gist google gadgets" />
<UserPref name="src" display_name="JSsrc" required="false" />
<Content type="html"><![CDATA[
<div id="target__MODULE_ID__"></div>
<script type="text/javascript">
var prefs = new _IG_Prefs(__MODULE_ID__);
var script = document.createElement("script");
script.src = prefs.getString("src");
# Created by Nando Vieira
# Usage: compound_interest(:amount => 1000, :interest => 0.1, :times => 5)
def compound_interest(options={})
options[:amount] * ((1 + options[:interest]) ** options[:times])
end
@twxxk
twxxk / gist:2659
Created July 26, 2008 14:34
tickを使った非同期実行の単純なサンプル
<?php
/**
* 非同期実行の意味なしサンプル
*/
class A {
private $name;
public function __construct($name){
$this->name = $name;
}
/**
# Copyright (c) 2008 Phusion
# http://www.phusion.nl/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
// based on implementation from rails http://rails-doc.org/rails/ActionView/Helpers/DateHelper/distance_of_time_in_words
// explanation at http://blog.peelmeagrape.net/2008/7/26/time-ago-in-words-javascript-part-1
// unittests at http://blog.peelmeagrape.net/assets/2008/7/26/distanceOfTimeInWords.html
function distanceOfTimeInWords(fromTime, toTime, includeSeconds) {
var fromSeconds = fromTime.getTime();
var toSeconds = toTime.getTime();
var distanceInSeconds = Math.round(Math.abs(fromSeconds - toSeconds) / 1000)
var distanceInMinutes = Math.round(distanceInSeconds / 60)
if (distanceInMinutes <= 1) {
if (!includeSeconds)
#!/Users/yanxu/jython2.2.1/jython
# encoding: utf-8
"""
poi.py
Created by yanxu on 2008-04-09.
Copyright (c) 2008 sina. All rights reserved.
"""
from org.apache.poi.hssf.usermodel import *