Skip to content

Instantly share code, notes, and snippets.

@desbo
desbo / image.php
Last active August 29, 2015 13:56
bad photos of phil hill script
<?php
class DogImage {
public $filename;
public $gdImage;
public $mimeType;
public $targetWidth = 960;
public $allowedTypes = array(
1, // [] gif
2, // [] jpg
@desbo
desbo / express-status.sh
Last active August 29, 2015 14:04
Fix deprecation warnings when using res.json(status, response) in Express 4.7.0 https://github.com/strongloop/express/blob/master/History.md#470--2014-07-25
find . -type f -exec sed -i -r -e 's/(jsonp?|send)\(([0-9]+)\,\ /status\(\2\)\.\1(/g' {} \;
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
@desbo
desbo / demo.xml
Created June 3, 2015 15:55
demo for nat
<Book>
<Title>Sherlock Holmes</Title>
<Author>Arthur Conan Doyle</Author>
</Book>
@desbo
desbo / scan.js
Last active February 4, 2020 17:13
javascript scan function
function scan(xs, f, acc) {
var result = [];
for (var i = 0; i < xs.length; i++) {
acc = result[result.push(f(acc, xs[i])) - 1];
}
return result;
}
@desbo
desbo / ff.sh
Created August 4, 2015 15:19
fontforge svg ripper
fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' font.ttf
@desbo
desbo / grid.hs
Created August 6, 2015 10:22
grid
data Grid a = Grid [[a]]
deriving Show
instance Functor Grid where
fmap f (Grid xs) = Grid (map (\ys -> map (\y -> f y) ys) xs)
@desbo
desbo / nat.html
Last active August 29, 2015 14:27
nat.html
<h1>Page title</h1>
<p>Intro paragraph.</p>
<h2>Sub-heading</h2>
<ul>
<li>First list item!</li>
<li>Second list item!</li>
</ul>
<h2>Another sub-heading</h2>
@desbo
desbo / nat.css
Last active August 29, 2015 14:27
<style type="text/css">
.blog-content h2 {
font-size: 120%;
font-weight: bold;
margin: .5em 0;
}
.blog-content ul {
margin: 1em 5em;
}
@desbo
desbo / tc.md
Last active August 27, 2015 16:32
TeamCity artifacts

root-packages

artifact paths

node_modules => node_modules.tar.gz
static/src/jspm_packages => jspm_packages.tar.gz
facia-tool/public/node_modules => facia_node_modules.tar.gz
facia-tool/public/jspm_packages => facia_jspm_packages.tar.gz

root-v2