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
using System.ComponentModel; | |
using System.Linq.Expressions; | |
using System; | |
using System.Reactive.Linq; | |
using System.Reactive; | |
namespace Foo | |
{ | |
public abstract class HasObservableProperties: INotifyPropertyChanged |
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
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
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
function fm(d){return [d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');} | |
function rn(a,d){var b=new Date();b.setDate(a.getDate()+d);var ds=[a,b].sort();return " pushed:["+fm(ds[0])+" TO "+fm(ds[1])+"]";} | |
function se(s,d){window.location="https://github.com/search?type=Repositories&q="+s+rn(new Date(),d);} |
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
var GitHubApi = require("github"); |
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
msiexec.exe APPLICATIONROOTDIRECTORY=C:\opt\nodejs /i node-v0.8.14-x64.msi |
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
ext = (f) -> (e=/^.+\.([^.]+)$/.exec(f)) and e[1] |
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
defaults write com.apple.mail UserHeaders {"Reply-To" = "user@host"; } |
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
(defun windows-in-use-time-order (&optional old-to-new windows) | |
"Windows sorted by their `window-use-time'. | |
Without arguments windows on current frame ordered from most to least recent. | |
Optional argument OLD-TO-NEW with non-nil value reverses the order. | |
Optional argument WINDOWS specifies which windows to sort by use time: | |
- a list is assumed to contain windows and sorted |
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
class Date | |
# prev_week and next_week, add/remove 7 days * optarg | |
['prev_','next_'].each{|n|define_method(n+'week'){|w=1|send n+'day',7*w}} | |
# other is Date to compare to | |
# wants tells what to include in timediff. default is years,months,weeks,days | |
# by default returns <timediff> from <earlier> to <later> | |
# if abs=true returns <self> is <timediff> later|earlier than <other> | |
def diff_str other, want="ymwd",abs=false | |
return "Both dates are #{self}" if self==other |
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
static public class FunFactory | |
{ | |
static public Func<TResult> Make<TResult>(TResult a, Func<TResult, TResult> step) | |
{ | |
TResult next=a; | |
return ()=>{ TResult cur=next; next=step(cur); return cur; }; | |
} | |
static public Func<TResult> Cycle<TResult>(IEnumerable<TResult> values) | |
{ |