Skip to content

Instantly share code, notes, and snippets.

View darkyen's full-sized avatar

Abhishek Hingnikar darkyen

View GitHub Profile
@darkyen
darkyen / thoughts.md
Last active August 29, 2015 14:25
GNUReligion

##Disclaimer The following are my own personal views, and are solely based on my understanding, I do not wish to offend anyone, this is merely a thought experiment.

##Religion is worlds first open source product

In the programming world we have the concept of open source software, where somebody writes the original code and publishes the product, people use it, add features to it when they disagree on the future of the product the product is essentially branched and eventually becomes completely different the major example of this is the well known

@darkyen
darkyen / file.es6.js
Created November 19, 2015 18:38
Async fluxxy login using auth0 and es7 with localForage for storage.
const AUTH0_URI = 'YOUR_URI';
const AUTH0_TOKEN = 'YOUR_TOKEN';
let lock = new Auth0Lock(AUTH0_TOKEN, AUTH0_URI);
import dispatcher from 'PATH_TO_DISPATCHER';
import localForage from 'localForage';
// Maybe you can drop this as its
// 2016 already !
import Promise from 'bluebird';
@darkyen
darkyen / chrome-tcp-backend.js
Created January 11, 2016 00:19
Chrome TCP Backend
import 'text-encoding';
import uuid from 'uuid';
// I am not really sure about this master luke.
const ChromeSocketServer = chrome.sockets.tcpServer;
const ChromeSocketClient = chrome.sockets.tcp;
const serverSocketListeners = {};
const clientSocketListeners = {};
const textEncoder = new TextEncoder();
@darkyen
darkyen / Testrun.txt
Created January 12, 2016 02:24
Testrun
C:\Users\abhis\Downloads>ab -n 1000 -c 100 http://192.168.1.5:4322/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.1.5 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@darkyen
darkyen / test.js
Created February 1, 2016 02:48
foo
export function openChannel(channelId){
return new Promise((resolve, reject) => {
const newChannel = new PusherGameChannel(channelId);
newChannel.once('connect', resolve);
newChannel.once('error', reject);
});
}
export async function openChannelWithServer(channelId){
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (process){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _plivo = require('plivo');
var _plivo2 = _interopRequireDefault(_plivo);
const Express = require('express');
const request = require('request-promise');
const Twitter = require('twit@2.2.3');
const Webtask = require('webtask-tools');
const jwt = require('jsonwebtoken');
const app = Express();
// A Much better approach which demonstrates API Auth is at
// https://github.com/vikasjayaram/twitter-status-webtask
@darkyen
darkyen / tsconfig.json
Created December 27, 2016 15:46
Problem, everything gets compiled, files not even required.
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": true,
"alwaysStrict": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"jsx": "react"