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(){ | |
if(!window.String.UUID){ | |
var matcher = /[xy]/g; | |
var replacer = function(c) { | |
var r = Math.random()*16|0; | |
var v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}; | |
//maybe shouldn't be modifying the global variable, but seems like the best place to put this. | |
window.String.UUID = function(){ |
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 fs = require('fs'); | |
var page = require('webpage').create(), | |
address, | |
output, | |
size; | |
if (phantom.args.length < 2 || phantom.args.length > 3) { | |
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat]'); | |
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); | |
phantom.exit(); |
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
/** | |
* Rangy, a cross-browser JavaScript range and selection library | |
* http://code.google.com/p/rangy/ | |
* | |
* Copyright 2012, Tim Down | |
* Licensed under the MIT license. | |
* Version: 1.3alpha.675 | |
* Build date: 23 June 2012 | |
*/ | |
window.rangy = (function() { |
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; | |
namespace BlogUtils | |
{ | |
/// <summary> | |
/// An extension of "Lazy of T, but with the twist that it will | |
/// reload the resource at periodic intervals (and on request, of course). | |
/// </summary> | |
public class LazyEnough<T> | |
{ |
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
public static dynamic ParseFunc (string func, out string error) | |
{ | |
dynamic retval = null; | |
error = null; | |
using (var ms = new MemoryStream()) { | |
using(var tr = new StreamWriter(ms)){ | |
var settings = new CompilerSettings(); |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using MonoTouch.UIKit; | |
namespace Async.iOS | |
{ | |
public static class Layout | |
{ |
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 proc = null; | |
grunt.registerTask('supervisor', function(){ | |
if(!proc){ | |
proc = grunt.util.spawn(this.options()); | |
} | |
}); | |
grunt.initConfig({ | |
supervisor : { |
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 is required in order to properly escape | |
// jade interpolation | |
jade = { | |
escape: function(html){ | |
return String(html) | |
.replace(/&/g, '&') | |
.replace(/</g, '<') | |
.replace(/>/g, '>') | |
.replace(/"/g, '"'); | |
} |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using MonoTouch.UIKit; | |
namespace Async.iOS | |
{ | |
public static class Layout | |
{ |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using MonoTouch.UIKit; | |
using System.Reflection; | |
using MonoTouch.Foundation; | |
namespace Praeclarum.UI | |
{ |