Skip to content

Instantly share code, notes, and snippets.

@defunkt
defunkt / installing-Mustache.tmbundle.md
Created March 6, 2010 10:27
Installing Mustache.tmbundle
@sehrgut
sehrgut / qbsort.js
Created November 11, 2011 17:58
quantum bogosort for javascript
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, undef:true, browser:true, indent:4, maxerr:50 */
/*
qbsort.js - quantum bogosort for javascript
Copyright (C) 3011 Keith Beckman
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@dabrahams
dabrahams / private_access.cpp
Created December 28, 2011 17:50
Accessing Private Data
#include <iostream>
// This is a rewrite and analysis of the technique in this article:
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html
// ------- Framework -------
// The little library required to work this magic
// Generate a static data member of type Tag::type in which to store
// the address of a private member. It is crucial that Tag does not
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@jacekd
jacekd / 2048-circle.js
Last active February 17, 2018 21:42
2048 keys in circle moves
function mouseEvent(type, sx, sy, cx, cy) {
var evt;
var e = {
bubbles: true,
cancelable: (type != "mousemove"),
view: window,
detail: 0,
screenX: sx,
screenY: sy,
clientX: cx,
@jacekd
jacekd / README.md
Last active February 17, 2018 21:46 — forked from mbostock/.block

Say your dataset is an array of numbers, and includes both positive and negative values. Use two scales to construct the bar chart: a quantitative scale (such as a [linear scale][1]) to compute the bar positions along the x-axis, and an [ordinal scale][2] with rangeBands to compute the bar positions along the y-axis.

For the quantitative scale, compute the data domain (the minimum and maximum value) using [d3.extent][3]:

var x = d3.scale.linear()
    .domain(d3.extent(data, function(d) { return d.value; }))
    .range([0, width]);

[Nicing][4] the scale will extend the extent slightly to the nearest round numbers. If you want the zero-value to be centered in the middle of the canvas, take the greater of the minimum and maximum value by magnitude, or simply hard-code the desired domain.

@sehrgut
sehrgut / curl-output.txt
Created January 3, 2016 21:56
How to hijack a page via a <script> tag loading HTML. Real-world example in curl-output.txt.
HTTP/1.1 302 Found
Date: Sun, 03 Jan 2016 19:58:45 GMT
Server: Apache
X-Powered-By: PHP/5.4.45-0+deb7u2
Location: http://ww31.gvisit.com/record.php?sid=592101993e8b9913eb0462e5bd4d7501
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
HTTP/1.1 200 OK
@examinedliving
examinedliving / c-lovers-manip.js
Created February 13, 2016 16:50
A little script for getting shades on color lovers, and displaying. Probably not useful for you
(function(){
function CManip(){
$=jQuery;
var script=$.getScript('//cdnjs.cloudflare.com/ajax/libs/tinycolor/1.3.0/tinycolor.js');
var $dro=$('.detail-row-overlay');
$dro.each(function(){$(this).css('display','block').css('box-shadow','none').css('-webkit-box-shadow','none').css('box-sizing','border-box').show().find('.color').show()});
var obj={

ブロックチェーン勉強会2

  • Thursday, May 26
  • AltCoin といわれるものから、その合意プロトコル的なものについていくつか紹介
  • TL;DR いっぱいありすぎてわかんねえ!

ブロックチェーンとは

ある事実なり履歴を改竄できない形で複製して保持する技術の総称