Skip to content

Instantly share code, notes, and snippets.

@ih2502mk
ih2502mk / gist:9233574
Created February 26, 2014 16:56
Curl command to get Github Auth token
curl -u <username> \
-d '{"scopes":["public_repo"],"note":"CI: demosite"}' \
https://api.github.com/authorizations
# See https://developer.github.com/v3/oauth/ for help on post data json
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@ih2502mk
ih2502mk / keybase.md
Created July 31, 2014 21:42
keybase.md

Keybase proof

I hereby claim:

  • I am ih2502mk on github.
  • I am ih2502mk (https://keybase.io/ih2502mk) on keybase.
  • I have a public key whose fingerprint is 56BB 0B57 B531 F848 990D 52C2 C672 856D E2B7 AFF7

To claim this, I am signing this object:

@ih2502mk
ih2502mk / index.js
Last active August 29, 2015 14:05
requirebin sketch
var mercury = require("mercury")
var h = mercury.h
var nextTick = require('next-tick')
var cuid = require('cuid')
var events = {
addItem: mercury.input()
};
var state = mercury.struct({
@ih2502mk
ih2502mk / tabular-JSON.md
Last active August 29, 2015 14:05
An idea for sending tabular data with less overhead both on amount of stuff to send and on amount of stuff to convert.

Tabular JSON

A transfer format that is a valid json but looks a lot like CSV and does not have overhead of sending repetitive parameter names.

{
  header: ["id", "username", "first_name", "last_name" ],
  data: [
    [1, "jsmith", "John", "Smith"],
@ih2502mk
ih2502mk / gist:16d3a3ac506e413c2a0c
Created September 22, 2014 15:53
Oneliner for getting parameters out of location.search
location.search
.slice(1)
.split('&')
.map(function(part) {return part.split('=')})
.reduce(function(acc, pair) {acc[pair[0]] = pair[1]; return acc}, {});
@ih2502mk
ih2502mk / app.js
Last active August 29, 2015 14:08 — forked from zulfajuniadi/app.js
/*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>VirtualDOM Example</title>
</head>
<body>
<div id="output"></div>
@ih2502mk
ih2502mk / js-object-key-value-stored.js
Last active August 29, 2015 14:14
js-key-value-storage-objects
universal_getter = function(id, prop_name, cb) {
// get it from db or some data set
// if fails set erro to `new Error()`
//
// if storage is locked wait till it gets unlocked
//
// goGetItFromDB(prop_name, function(err, val) {
return cb(err, val);
// })
@ih2502mk
ih2502mk / index.js
Last active August 29, 2015 14:15
requirebin sketch
var mercury = require("mercury")
var h = mercury.h
var nextTick = require('next-tick')
var rnd_str = require('random-string')
var events = {
addItem: mercury.input(),
removeItem: mercury.input()
};
@ih2502mk
ih2502mk / index.js
Last active August 29, 2015 14:15
requirebin sketch
var mercury = require("mercury")
var h = mercury.h
var nextTick = require('next-tick')
var rnd_str = require('random-string')
var events = {
addItem: mercury.input(),
removeItem: mercury.input()
};