Skip to content

Instantly share code, notes, and snippets.

Avatar

Abhishek Hingnikar darkyen

View GitHub Profile
@darkyen
darkyen / gist:120c46739985ebf3b39b
Created Jun 10, 2015
Ferengi Rules of Acquisition [Complete List*]
View gist:120c46739985ebf3b39b
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode)
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel)
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode)
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel)
5 "Always exaggerate your estimates." Cold Fusion (SCE novel)
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode)
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode)
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel)
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode)
10 "Greed is eternal." "Prophet Motive" (VOY episode)
@darkyen
darkyen / jsMp3dec.js
Last active May 2, 2019
A javascript based decoder for mp3 frame parsing supports id3
View jsMp3dec.js
/*
var net = require('net');
var http = require('http');
var listeners = [];
var Meta = {};
var streamer = http.createServer(function(req,res){
res.write('ICY 200 OK\r\nicy-notice1:<BR>FUCK OFF <BR>icy-notice2:SHOUTcast Distributed Network Audio Server/posix v1.2.3<BR>icy-name:'+Meta.name+'\r\nicy-genre:'+Meta.genre+'\r\nicy-url:'+Meta.url+'\r\nContent-Type:audio/mpeg\r\nicy-pub:1\r\nicy-br:'+Meta.br+'\r\nicy-metaint:8192\r\n\r\n');
listeners.push(res);
});
View project.c
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
/*
***************************************************************************
* Programmer : Abhishek Hingnikar *
* AIM : Mobile Shop Management System in C *
***************************************************************************
*/
@darkyen
darkyen / decoder.cpp
Created Jul 12, 2012
C++ ffmpeg decoder
View decoder.cpp
/*
* encoder.cpp
*
* Created on: Jul 12, 2012
* Author : Abhishek Hingnikar
* @TODO: remove the file deps.
* ADD STREAM DEPS so that u can buffer output.
* Structure
* @JSAPI
* ffmpeg{
@darkyen
darkyen / Id3NodeReader.js
Created Apr 24, 2012
A simple ID3v2.3.0 Tag Reader written for node.js
View Id3NodeReader.js
var fs = require('fs');
var Buffer = require('buffer').Buffer;
var id3Reader = new (function(){
// Credits to esailja //
var self = this;
function id3Size( buffer ) {
var integer = ( ( buffer[0] & 0x7F ) << 21 ) |
( ( buffer[1] & 0x7F ) << 14 ) |
( ( buffer[2] & 0x7F ) << 7 ) |
@darkyen
darkyen / tsconfig.json
Created Dec 27, 2016
Problem, everything gets compiled, files not even required.
View tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": true,
"alwaysStrict": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"jsx": "react"
View webtask.js
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
View gist:c29f07771d763602f5c6
(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);
View test.js
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){
View Testrun.txt
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
You can’t perform that action at this time.