Skip to content

Instantly share code, notes, and snippets.

@ikouchiha47
ikouchiha47 / README.md
Last active December 12, 2016 21:00
Basic Setup for using any oh-my-zsh theme without full oh-my-zsh installtion

###Installation

  • Create a directory
  • Paste the script inside the directory
  • Inside the directory create a themes/ directory
  • Paste any .oh-my-zsh themes (with .zsh-theme extesion) in here
  • In your .zshrc add
    • export ZSH_THEME="theme-name"
  • source $path_to_script/base.sh
@ikouchiha47
ikouchiha47 / _README.md
Created November 17, 2016 02:48 — forked from morganrallen/_README.md
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
`node --nouse-idle-notification --expose-gc --max-old-space-size=8192 testserver.js`
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 localhost (be patient).....done
Server Software:
def gen_dates(arr)
arr.reduce([]) do |acc, v|
if acc.last
d = Date.parse(v)
diff = (Date.parse(acc.last) - d).to_i
if diff == 1
acc.push(v)
else
acc.concat((1..(diff-1)).map { |i| (d + i).strftime("%Y-%m-%d") })
@ikouchiha47
ikouchiha47 / config.rb
Last active September 19, 2016 14:04
ruby csv parser memory test
class Config
class << self
def get
env = ENV["RUBY_ENV"] || "developement"
env = env.downcase
require_relative "./environments/" + downcase
end
end
end
@ikouchiha47
ikouchiha47 / migrate.js
Created September 15, 2016 14:42
migration generator
'use strict'
const fs = require('fs')
const path = require('path')
const migrationsFolder = path.join(__dirname, "/migrations")
const recordFile = path.join(__dirname, "/schema_migrations")
let client = require('./connection')()
let Commands = {
make: make,
@ikouchiha47
ikouchiha47 / tut.md
Last active May 14, 2021 11:12
Implementing a peer to peer chat prototype in nodejs.

prologue

Why another tutorial? Because there are other tutorials which write a server - client or maybe a client client where they have only two clients, maybe by hardcoding ips.

<rant>
  What annoys me more is, that there are 100's of same tutroials on the internet, 
 that just works for a given scenario, but guess what, I don't fucking care what works
@ikouchiha47
ikouchiha47 / Foods_2.js
Last active September 12, 2016 11:02
react-native
'use strict';
const React = require('react');
const ReactNative = require('react-native');
const { StyleSheet, View, Text, ListView, ScrollView, TouchableHighlight } = ReactNative;
const urlBase = 'http://192.168.1.131:4001/api';
function group(array, n) {
n = n ? n : 1
let res = []
@ikouchiha47
ikouchiha47 / tcp.js
Last active September 2, 2016 13:38
parsing tcp data
const net = require('net')
const DELIMT = '----AxEB04'
// create a server, when the data arrives, push it to the existing buffer
// convert to string to check wether the delimiter is present
// if not, message is still not completed
// if yes, split the data
function parseDelimitedMessage() {
let buff = new Buffer('');
@ikouchiha47
ikouchiha47 / dfH.js
Last active August 31, 2016 12:04
trying dfh in js
const crypto = require('crypto');
const assert = require('assert');
function DeffMan(prime, generator) {
this.user = prime && generator ? crypto.createDiffieHellman(prime, generator) : crypto.createDiffieHellman(120)
this.sharedPrime = this.user.getPrime()
this.generator = this.user.getGenerator()
}
DeffMan.prototype.getPublicKey = function() {