I hereby claim:
- I am linus on github.
- I am yesbabyyes (https://keybase.io/yesbabyyes) on keybase.
- I have a public key whose fingerprint is DC4B 6A42 0A58 45E0 8F42 6943 30E7 9CC0 DEF0 C03E
To claim this, I am signing this object:
// Takes a board generated by the bingo() function below, and returns | |
// a HTML table. | |
function boardToHTML(board) { | |
return ` | |
<table> | |
${chunk(board, 3).map(card => `<tbody> | |
${card.map(row => `<tr> | |
${row.map(cell => `<td> | |
${cell ? cell.toString().padStart(2, '0') : ''} | |
</td>`).join('')} |
class Video extends Inline { | |
get attrs() { | |
return { | |
url: new Attribute, | |
id: new Attribute({compute: function (attrs) {console.log(attrs);return videoRE.exec(attrs.url)[2]}}), | |
type: new Attribute({compute: function (attrs) {console.log(attrs);return videoRE.exec(attrs.url)[1]}}), | |
width: new Attribute({default: "640"}), | |
height: new Attribute({default: "480"}) | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
var foo = 1, bar = 2; | |
var foo = 1 | |
, bar = 2; | |
var foo = 1, | |
bar = 2; | |
var foo = 1; | |
var bar = 2; |
linus@Newton:~$ redis-cli | |
redis 127.0.0.1:6379> publish /updates.foo "hello there!" | |
(integer) 1 | |
redis 127.0.0.1:6379> |
linus@Newton:~/development/projects/turkey$ ab -n 10000 http://localhost:3000/A012B490 | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 1000 requests | |
Completed 2000 requests | |
Completed 3000 requests | |
Completed 4000 requests |
var http = require("http"); | |
// Responses for various urls | |
var responses = { | |
"/createUser": "foo", | |
"/deleteUser": "bar" | |
}; | |
var server = http.createServer(function(req, res) { | |
// Listen for data on request |
# Main function. Takes the original image and a list of | |
# profile pictures, and returns the finished, improved, mosaic | |
def create_better_mosaic(original_image, profile_pictures): | |
# Calculate the width and height of the scaled image, where | |
# each profile picture maps to a pixel in the original image | |
width, height = image_ratio(original_image, len(profile_pictures)) | |
# Get the pixel values of the scaled image, "unfolded" in | |
# one dimension | |
pixels = get_pixels_one_dimensional(original_image, width, height) | |
# Get a list of tuples with (image, color) for each profile picture |
# Return the Euclidean distance between color_a and color_b. | |
# We optimize a little and don't calculate the square root of the distance. | |
# The sum of the squares of deltas is good enough. | |
def color_distance(color_a, color_b): | |
delta_red = color_a[0] - color_b[0] | |
delta_green = color_a[1] - color_b[1] | |
delta_blue = color_a[2] - color_b[2] | |
return delta_red * delta_red + delta_green * delta_green + delta_blue * delta_blue |
# Complex class from http://docstore.mik.ua/orelly/webprog/jscript/ch08_05.htm#jscript4-CHP-8-EX-6 | |
class Complex | |
constructor: (@x, @y) -> | |
magnitude: -> | |
Math.sqrt @x * @x + @y * @y | |
negative: -> | |
new Complex -@x, -@y |