Skip to content

Instantly share code, notes, and snippets.

@nkhine
nkhine / cognito.yaml
Created August 24, 2017 05:04 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
@nkhine
nkhine / rt.js
Last active February 14, 2017 14:24
rt.js
!function(f) {
function e(a) {
if(n[a])return n[a].exports;
var u=n[a]= {
exports: {}
,
id: a, loaded: !1
}
;
return f[a].call(u.exports, u, u.exports, e),
$ git diff lib/express/plugins/body-decoder.js
diff --git a/lib/express/plugins/body-decoder.js b/lib/express/plugins/body-decoder.js
index 1d67ff4..4ec448c 100644
--- a/lib/express/plugins/body-decoder.js
+++ b/lib/express/plugins/body-decoder.js
@@ -22,7 +22,7 @@ exports.BodyDecoder = Plugin.extend({
var request = event.request
if (request.header('Content-Type') &&
request.header('Content-Type').includes('application/x-www-form-urlencoded'))
- request.params.post = queryString.parseQuery(request.body)
@nkhine
nkhine / output
Last active December 21, 2016 23:02
'uuid': {
'name': 'String',
'statement_descriptor': 'String',
'persona': 'String',
'created': timestamp,
'interval': timestamp[day/month/year],
'interval_count': 1,
'livemode': boolean,
'trial_period_days': int
'hourly': boolean
@nkhine
nkhine / data
Created December 21, 2016 10:01
"data": [
{
"id": "1hr-test-gbp",
"object": "plan",
"amount": 1000,
"created": 1482085325,
"currency": "gbp",
"interval": "month",
"interval_count": 1,
"livemode": true,
@nkhine
nkhine / cube.js
Created July 31, 2012 14:00
cube in D3
/**
* cubeD3 Create a rotating cube with D3.js:
*
* @param id div id tag starting with #
* @param width width of the grid in pixels
* @param height height of the grid in pixels
* @param square
*/
function cubeD3(id, width, height)
{
@nkhine
nkhine / _.md
Created June 22, 2016 08:33 — forked from PyYoshi/_.md
Disable Transparent Huge Pages on CoreOS
$ sudo -i
# vim /etc/systemd/system/disable-transparent-huge-pages.service
# systemctl enable disable-transparent-huge-pages
# systemctl start disable-transparent-huge-pages
# systemctl status disable-transparent-huge-pages
# cat /sys/kernel/mm/transparent_hugepage/enabled
# cat /sys/kernel/mm/transparent_hugepage/defrag
@nkhine
nkhine / coreos-windows-share.sh
Created March 8, 2016 09:00 — forked from pantelis/coreos-windows-share.sh
Mount Windows share drives on CoreOS
# WARNING - THIS IN NOT a SHELL SCRIPT - JUST a LIST of COMMANDS
# based on https://github.com/coreos/coreos-overlay/issues/595 with links updated
# Build cifs-utils in a container and copy it into /tmp on the host.
$docker run -t -i -v /tmp:/host_tmp fedora /bin/bash
# On the container bash prompt
yum groupinstall -y "Development Tools" "Development Libraries"
yum install -y tar
yum install -y bzip2
curl http://ftp.samba.org/pub/linux-cifs/cifs-utils/cifs-utils-6.3.tar.bz2 | bunzip2 -c - | tar -xvf -
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<div id="viz"></div>
<div id="scale">scale: <span>240</span></div>
<script type="text/javascript">
@nkhine
nkhine / gist:5917572
Created July 3, 2013 12:43
zukai, npm test
✖ 26 of 130 tests failed:
1) Default Plugins relation should allow missing relationship when minItems=0:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/Users/khinester/Sandboxes/zukai/node_modules/mocha/lib/runnable.js:167:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
2) Default Plugins relation should not allow missing relationship when minItems=1:
Error: timeout of 2000ms exceeded
at null.<anonymous> (/Users/khinester/Sandboxes/zukai/node_modules/mocha/lib/runnable.js:167:14)