Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Confetti</title>
<style>
#confettotainer {
position: absolute;
width: 100vw;
height: 100vh;
overflow: hidden;
}
@ntlk
ntlk / upload_to_elasticsearch.js
Last active November 3, 2016 10:44
Upload MOH reports to elasticsearch
const elasticUrl = 'xxx';
const exec = require('child_process').exec;
const sleep = require('sleep');
const fs = require('fs');
const path = require('path');
const batchSize = 2;
let sliceBeg = 0;
let sliceEnd = sliceBeg + batchSize;
@ntlk
ntlk / craig_wright.txt
Last active May 3, 2016 12:30
How the BBC updated their story on Craig Wright claiming to be Satoshi Nakamoto / story: http://www.bbc.co.uk/news/technology-36168863 / original story: https://web.archive.org/web/20160502080513/http://www.bbc.co.uk/news/technology-36168863
Australian entrepreneur Craig Wright has publicly identified himself as Bitcoin creator Satoshi Nakamoto.
His admission follows years of speculation about who came up with the original ideas underlying the digital cash system.
Mr Wright has provided technical proof to back up his claim using coins known to be owned by Bitcoin’s creator.
Prominent members of the Bitcoin community and its core development team say they have confirmed his claims.
But many others in the Bitcoin world are asking for more proof.
Mr Wright has revealed his identity to three media organisations - the BBC, the Economist and GQ.
At the meeting with the BBC, Mr Wright digitally signed messages using cryptographic keys created during the early days of Bitcoin’s development. The keys are inextricably linked to blocks of bitcoins known to have been created or “mined” by Satoshi Nakamoto.
Dorian Satoshi Nakamoto was wrongly identified as the inventor of Bitcoin in 2014
“These are the blocks used to send 10 bitcoins to Hal Finney in January
@ntlk
ntlk / bind.js
Last active August 29, 2015 14:25 — forked from threedaymonk/bind.js
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(thisValue){
var func = this;
return function() {
return func.apply(thisValue, arguments);
}
}
}
@ntlk
ntlk / ologline.ml
Last active August 29, 2015 14:16
Ologline
let log_string = "61.135.219.2 - - [01/Mar/2015:21:42:13 +0300] \"GET /atom.xml HTTP/1.1\" 304 - \"-\" \"Mozilla/5.0 (compatible;YoudaoFeedFetcher/1.0;http://www.youdao.com/help/reader/faq/topic006/;1 subscribers;)\"";
type logline = {
remote_host: string;
client_identity: string;
userid: string;
timestamp: string;
request_line: string;
status_code: int;
object_returned_size: string;
@ntlk
ntlk / ogrep.ml
Last active August 29, 2015 14:16
Rudimentary, case insensitive grep in OCaml
let pattern = Sys.argv.(1);;
let filename = Sys.argv.(2);;
let string_contains s1 s2 =
try
let len = String.length s2 in
for i = 0 to String.length s1 - len do
let lowercase_s1 = String.lowercase s1 in
let lowercase_s2 = String.lowercase s2 in
if String.sub lowercase_s1 i len = lowercase_s2 then raise Exit
@ntlk
ntlk / image-2x.scss
Created May 22, 2014 13:46
image-2x sass mixin
@mixin image-2x($image, $width: 'auto', $height: 'auto') {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
background-image: url($image);
@if $width == 'auto' {
background-size: contain;
} @else {
@ntlk
ntlk / hannibal2.py
Created April 7, 2014 12:55
Counting appearances of Hannibal Lecter in films the easy way
import sys
import time
import json
import datetime
from termcolor import colored
print('Hannibal Lecter appearance counter')
title = input('Please enter the film title: ')
occurrences = []
@ntlk
ntlk / hannibal.py
Last active August 29, 2015 13:58
Counting appearances of Hannibal Lecter on screen
import sys
import datetime
import json
from time import strftime
from termcolor import colored
print('Hannibal Lecter appearance counter')
title = input('Please enter the film title: ')
recording = False
@ntlk
ntlk / visual_twitter.html
Created December 12, 2013 15:10
visual twitter
<!doctype html>
<html>
<head>
<title>Visual Twitter</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
// search twitter for a keyword
var url = "http://twitcher.steer.me/search?q=christmas&key=XXX";