Skip to content

Instantly share code, notes, and snippets.

View alessioalex's full-sized avatar

Alexandru Vlăduţu alessioalex

View GitHub Profile
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
@alessioalex
alessioalex / rwd.css
Created July 31, 2014 15:15 — forked from trey/rwd.css
/* http://twitter.github.com/bootstrap/scaffolding.html#responsive */
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 768px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 940px) { ... }
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2014
Copyright (C) 2014 Addy Osmani @addyosmani
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@alessioalex
alessioalex / convert.js
Last active August 29, 2015 14:10 — forked from rf/convert.js
var fs = require('fs');
var infile = process.argv[2];
if (!infile) return console.log("need infile");
var data = fs.readFileSync(infile, 'utf8').split('\n');
var outlines = [];
data.forEach(function(item) {
$ cat test.js
function foo () { while (true) { } }
function bar () { return foo(); }
bar();
$ node test.js &
$ gdb attach $(pidof node)
0x00000bf778c63d5f in ?? ()
(gdb) b v8::internal::Runtime_StackGuard
Breakpoint 1 at 0x84a1f0
(gdb) print 'v8::V8::TerminateExecution'(0)
@alessioalex
alessioalex / nodejs
Created March 24, 2011 10:14 — forked from mvrilo/nodejs
# node.js app under nginx
upstream node {
server 127.0.0.1:8001;
}
server {
listen 80;
server_name node;
@alessioalex
alessioalex / nodejs.sh
Created June 20, 2011 09:42 — forked from crcastle/nodejs.sh
Node.js tartup script for AWS EC2 Linux box
#!/bin/bash
# nodejs - Startup script for node.js server
# chkconfig: 35 85 15
# description: node is an event-based web server.
# processname: node
# server: /path/to/your/node/file.js
# pidfile: /var/run/nodejs.pid
#
@alessioalex
alessioalex / node_debian_init.sh
Created June 20, 2011 09:42 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28