Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SubSonic.DataProviders;
using SubSonic.Repository;
using SubSonic.Tests.Repositories;
using SubSonic.Tests.Repositories.TestBases;
using Xunit;
@saintedlama
saintedlama / installmongodb.sh
Last active December 31, 2015 06:19
install scripts for my ubuntu dev box
#!/bin/bash
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org
@saintedlama
saintedlama / enhancescan.js
Last active August 29, 2015 13:56
Enhance camera "scanned" documents with gm
var gm = require('gm');
if (process.argv.length != 4) {
console.log('Usage: enhancescan input output');
process.exit(2);
}
var input = process.argv[2];
var output = process.argv[3];
Artifex "Inquiry"
Thank you for expressing your interest in licensing Ghostscript or MuPDF and/or our screening technologies. We are the developers and owners of Ghostscript, MuPDF and the sole commercial licensors of ETS. We are not bound by GNU restrictions. We will require the following information about your business and the application(s) for which you'll be using our technologies. The completion and answers to every line item below will be required in order to prepare a formal licensing proposal.
1.) Briefly describe the product in which our technologies will be used.
2.) To what function will our technology be applied?
3.) What percentage of functionality of the overall product will our technology provide?
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variable name="json" value="{ &quot;level&quot; : &quot;${lowercase:${level}}&quot;, &quot;message&quot; : &quot;${message}&quot; }"/>
<targets>
<target name="udp" xsi:type="Network" address="udp://127.0.0.1:9999" layout="${json}" />
<target name="console" xsi:type="ColoredConsole" layout="${json}"/>
</targets>
/* Based on Sublime Text's Monokai theme */
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
.cm-s-monokai span.cm-comment {color: #75715e;}
.cm-s-monokai span.cm-atom {color: #ae81ff;}
@saintedlama
saintedlama / Chart.Series.js
Created December 3, 2014 13:21
Chart.js Series Chart
(function() {
"use strict";
var Chart = this.Chart;
var helpers = Chart.helpers;
Chart.SeriesScale = Chart.Scale.extend({
calculateXLabelRotation : function() {
this.xLabelWidth = 0;
this.xScalePaddingRight = this.padding;
@saintedlama
saintedlama / dropdownnav.html
Last active August 26, 2015 14:19
bootstrap angular dropdown nav
<li ng-class="{ open : isOpen }">
<a href="#" prevent-default="" ng-click="isOpen = !isOpen">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li ><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
@saintedlama
saintedlama / codemo.js
Last active September 18, 2015 12:07
A better co example
'use strict';
const co = require('co');
const fs = require('fs');
co(function* () {
let readFile = (resolve, reject) => {
fs.readFile('./codemo.js', { encoding : 'utf-8' }, function(err, content) {
if (err) {
return reject(err);
conn = new Mongo();
db = conn.getDB("bios");
db.bios.insert([{
"_id" : 1,
"name" : {
"first" : "John",
"last" : "Backus"
},
"birth" : ISODate("1924-12-03T05:00:00Z"),