Skip to content

Instantly share code, notes, and snippets.

<html>
<script src="http://fb.me/react-0.13.3.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.3.js"></script>
<style>
/* Styles go here */
.player {
width: 300px;
background-color: #000;
color: #fff;
"use strict";
const cluster = require("cluster");
const numCpus = require("os").cpus().length;
const stream = require("stream");
const util = require("util");
const redis = new require("ioredis")();
const sqlite3 = require('sqlite3').verbose();
const split = require("split");
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var routes = require('./routes/index');
@ikouchiha47
ikouchiha47 / you.tube.js
Created October 24, 2015 22:02
youtube downoader
var you = function(h, D) {
var frag = D.createDocumentFragment(),
count = 0,
len = 1;
h("#yt-masthead-content").appendChild(m("div", "", {className: "download"}, {paddingRight: "20px", height: "200px", overflowY: "scroll"}))
function addLinks(d, r) {
h(".download").appendChild(m("a",
d.title,
{className: "links", href: d.url, download: d.title + "." + r},
@ikouchiha47
ikouchiha47 / install_scala_sbt.sh
Created October 5, 2015 04:59 — forked from visenger/install_scala_sbt.sh
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
@ikouchiha47
ikouchiha47 / multiple_ssh_setting.md
Last active August 29, 2015 14:26 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@ikouchiha47
ikouchiha47 / Functional.c
Created July 9, 2015 03:23
Functional programming with c , integer types
#include<stdio.h>
#include<stdlib.h>
#define arrlen(x) (sizeof(x)/sizeof((x)[0]))
int callback( int i ) {
return i * 2;
}
int callback_filter( int i ) {
function $( selector ) {
if( typeof selector === "string" )
return new dom(selector);
else if (selector instanceof Node)
return new dom(selector);
}
//thanks to AwalGarg
$.id = function( selector ) {
return $( '#' + selector );
@ikouchiha47
ikouchiha47 / app.js
Last active October 24, 2015 21:53
live editor
var app = require('http').createServer(handler),
io = require('socket.io').listen(app),
path = require('path'),
fs = require('fs');
app.listen(9000);
function handler (req, res) {
var filePath = '.' + req.url;
if (filePath == './')