This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
strikethrough means I've done it
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
strikethrough means I've done it
# git ls-files --others --exclude-from=.git/info/exclude | |
# Lines that start with '#' are comments. | |
# For a project mostly in C, the following would be a good set of | |
# exclude patterns (uncomment them if you want to use them): | |
# *.[oa] | |
# *~ | |
# .gitignore for .NET projects | |
# Thanks to Derick Bailey |
public static class DateTimeUtils { | |
public static TimeSpan TimeTill(this DateTime now, TimeSpan target) { | |
//TimeOfDay gives you the time elapsed since midnight as a TimeSpan | |
var difference = target.Subtract(new TimeSpan(now.Hour,now.Minute,now.Second)); | |
//check for negative TimeSpan, | |
//it means the target time occurs on the next day, just add 24 hours | |
if (difference < TimeSpan.Zero) |
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
class Test { | |
static void Main() | |
{ | |
var items = new List<string>() { | |
"foo_20120212", | |
"foo_20120213", | |
"foo_20120214", |
/* | |
* jQuery.ajaxQueue - A queue for ajax requests | |
* | |
* (c) 2011 Corey Frang | |
* Dual licensed under the MIT and GPL licenses. | |
* | |
* Requires jQuery 1.5+ | |
*/ | |
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery) |
{ | |
"maxcount": 20, | |
"login-enabled": false, | |
"msg-hiddennamejoin": "Player joined", | |
"quitmessage": "%playername% quit", | |
"webchat-requires-login": false, | |
"worlds": [ | |
{ | |
"center": { | |
"z": 300, |
(*@ | |
Note that this is directly from his blog post on https://github.com/tpetricek/TomaspNet.Website/blob/master/source/blog/2013/tuples-in-csharp.fsx | |
The only minor addition is on L162: | |
yield [ for p in meth.GetParameters() -> p.ParameterType.ToString() + ": " + p.Name ] } | |
where we added the name of the parameter in the key for the grouping. Results are interesting! | |
Also added a Dump on L180 for LinqPad :) | |
*) |
using System; | |
namespace SemitoneCalculator | |
{ | |
public static class ToneExtensions | |
{ | |
public static Tone Up(this Tone tone) | |
{ | |
return tone.Name == ToneName.B | |
? new Tone(ToneName.C, tone.Octave + 1) |
public class EnumerableOfStringParser : IValueParser | |
{ | |
private readonly string _separator; | |
public EnumerableOfStringParser(string separator = null) | |
{ | |
_separator = separator; | |
} | |
public bool CanParse(Type settingValueType) |
import {customAttribute} from 'aurelia-framework'; | |
import {autoinject} from 'aurelia-framework'; | |
import * as $ from "jquery"; | |
@autoinject | |
@customAttribute('found') | |
export class FoundationCustomAttribute { | |
constructor(private element: Element) { | |
} |