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; | |
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
/** | |
* 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
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
(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
# == Schema Information | |
# Schema version: 20110430183939 | |
# | |
# Table name: projects | |
# | |
# id :integer not null, primary key | |
# name :string(255) | |
# created_at :datetime | |
# updated_at :datetime | |
# |
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
# == Schema Information | |
# Schema version: 20110429204914 | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# full_name :string(255) | |
# email :string(255) | |
# salt :string(255) | |
# created_at :datetime |
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 class ChunkUtils | |
{ | |
public static IEnumerable<T> Chunk(Func<int,IEnumerable<T>> chunkFunc){ | |
var taken = 0; | |
var last = 0; | |
do{ | |
last = taken; | |
var values = chunkFunc(taken);//taken is the "skip" count, the "take" count will have been closed into the chunkFunc. | |
foreach(var v in values) |
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
// 0. find your XML feed url and combine it with | |
// (ex. 'http://news.google.com?output=rss&q=javascript') | |
var jsonFeed = 'http://jsonr.com/json/news.google.com?output=rss&q=javascript' | |
//1. get the json and apply it. | |
jQuery.getJSON(jsonFeed,null,function(jsonObj){ | |
//2. use the jsonObj for good. | |
alert(jsonObj); | |
}); |
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 Manos; | |
namespace pies | |
{ | |
public class DBModule : ManosModule | |
{ | |
public DBModule () | |
{ | |
} |