I hereby claim:
- I am tdantas on github.
- I am tdantas (https://keybase.io/tdantas) on keybase.
- I have a public key whose fingerprint is 1DB8 9719 1769 124D BD40 42B9 9DD5 A342 1345 BB52
To claim this, I am signing this object:
var Page = new Schema({ | |
title: { type: String, default: '', trim: true }, | |
url: { type: String, default: '', trim: true }, | |
thumbnails: {type: Schema.ObjectId, ref: 'Thumbnails'}, | |
}); | |
Page.post('save', function(doc) { | |
if(doc.thumbnails) return; | |
Thumbnail.generate(doc.url, function(err, thumb){ | |
doc.thumbnails = thumb; |
defmodule FizzBuzz do | |
defp run(0, 0, _), do: "FizzBuzz" | |
defp run(0, _, _), do: "Fizz" | |
defp run(_, 0, _), do: "Buzz" | |
defp run(_, _, z), do: z | |
def of(n), do: run( rem(n,3), rem(n,5), n) | |
end |
defmodule Swap do | |
def of([ ], _, _), do: [ ] | |
def of(list, left, left), do: list | |
def of(list, left, right) do | |
list | |
|> List.replace_at(left, nth(list, right)) | |
|> List.replace_at(right, nth(list, left)) | |
end |
defmodule Max do | |
def of([ head ]), do: head | |
def of([ first, second | tail]) do | |
case first >= second do | |
true -> of([ first | tail]) | |
false -> of([ second | tail]) | |
end | |
end |
curl -H 'Content-Type: application/json' -X PUT http://localhost:5984/DATABASE/_design/NAME -d \ | |
'{ | |
"filters":{ | |
"filterName":"function(doc, req) { | |
return true; | |
}" | |
} | |
}' |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
var page; | |
window.onload = function() { | |
page = document.getElementsByTagName('html'); | |
page.addEventListener('DOMMouseScroll', <HANDLER>, false); | |
} | |
window.mimicWheel = function() { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent('DOMMouseScroll', <OPTIONS> ) |
I hereby claim:
To claim this, I am signing this object:
$ node | |
> var m = require('module'); | |
undefined | |
> require.toString() | |
'function require(path) {\n return self.require(path);\n }' | |
> module.require.toString() | |
'function (path) {\n assert(path, \'missing path\');\n assert(util.isString(path), \'path must be a string\');\n return Module._load(path, this);\n}' | |
> m.wrapper | |
[ '(function (exports, require, module, __filename, __dirname) { ', | |
'\n});' ] |
const fs = require('fs'); | |
const path = require('path'); | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const cors = require('cors'); | |
const modulePath = path.join(__dirname, 'modules'); | |
const resources = fs.readdirSync(modulePath); |