Skip to content

Instantly share code, notes, and snippets.

View mkuklis's full-sized avatar
🏃‍♂️

Michał Kuklis mkuklis

🏃‍♂️
View GitHub Profile
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@remy
remy / audiosprite.js
Created December 23, 2010 13:54
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
@igstan
igstan / state-monad.js
Created May 1, 2011 23:09
State Monad in JavaScript
var push = function (value) {
return function (stack) {
var newStack = [value].concat(stack);
return { value:undefined, stack:newStack };
};
};
var pop = function () {
return function (stack) {
var value = stack[0];
@Raynos
Raynos / a.md
Created January 23, 2012 19:48
Shim status of ES6

ES6 what can be shimmed and what not.

Currently only lists things that can be shimmed or are experimentally implemented

Note that for any kind of decent ES6 support we need an ES6 transpiler. A few projects are attempting this [Reference SO question][3]

  • [traceur][4]
  • [Caja][5]
  • [ES transpiler][6]
@creationix
creationix / output.log
Created May 8, 2013 22:02
Working version of generator async code sample. Using node from https://github.com/andywingo/node/tree/v8-3.19
tim@touchsmart:~/Code$ nvm use v0.11.2-generators
Now using node v0.11.2-generators
tim@touchsmart:~/Code$ node --harmony testgen.js
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...>
Sleeping for 2000ms...
Done
@creationix
creationix / run.js
Last active November 27, 2017 16:06
A tiny generator helper for consuming callback code directly
function run(generator) {
var iterator = generator(resume);
var data = null, yielded = false;
iterator.next();
yielded = true;
check();
function check() {
while (data && yielded) {
@crosbymichael
crosbymichael / Dockerfile
Last active January 8, 2022 13:47
Docker with supervisor
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y openssh-server supervisor
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
RUN mkdir -p /var/run/sshd
@max-mapper
max-mapper / index.js
Created July 18, 2013 17:40
requirebin sketch
var reverse = require('ascii-art-reverse')
// makes a visible HTML console
require('console-log').show(true)
var coolbear =
" ('-^-/') \n" +
" `o__o' ] \n" +
" (_Y_) _/ \n" +
" _..`--'-.`, \n" +
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

<!doctype html>
<input id="query" type="text"></input>
<button id="search">Search</button>
<p id="results"></p>
<script src="bundle.js"></script>