Skip to content

Instantly share code, notes, and snippets.

View deoxxa's full-sized avatar

Conrad Pankoff deoxxa

View GitHub Profile
#!/usr/bin/env ruby
RAILS_ROOT = File.expand_path '../..', __FILE__
require "rubygems"
require "yaml"
require "tiny_tds"
require "singleton"
class Connection
include Singleton
@deoxxa
deoxxa / gist:4351300
Last active December 10, 2015 00:28 — forked from kanryu/gist:4351283
//// problem: node.js make memory leaks about child_proces
//
// the javascript doing it tha same to the shell code
// $ cat mako_* | ./ffmpeg -y -f image2pipe -r 1 -vcodec bmp -r 29.7 -i - -vcodec utvideo movie.avi
var ffmpeg = require('basicFFmpeg');
var fs = require('fs');
var sprintf = require('sprintf').sprintf;
var spawn = require('child_process').spawn,
// ,----,
// ,/ .`| ,--,
// ,-.----. ,---,. ,---, ,---, ,` .' : ,--.'| ,---,.
// \ / \ ,' .' | ' .' \ .' .' `\ ; ; / ,--, | : ,' .' |
// ; : \ ,---.' | / ; '. ,---.' \ .'___,/ ,',---.'| : ',---.' |
// | | .\ : | | .': : \ | | .`\ | | : | | | : _' || | .'
// . : |: | : : |-,: | /\ \ : : | ' | ; |.'; ; : : |.' |: : |-,
// | | \ : : | ;/|| : ' ;. : | ' ' ; : `----' | | | ' ' ; :: | ;/|
// | : . / | : .'| | ;/ \ \' | ; . | ' : ; ' | .'. || : .'
// ; | | \ | | |-,' : | \ \ ,'| | : | ' | | ' | | : | '| | |-,
@deoxxa
deoxxa / domdown.js
Created October 5, 2012 10:41
html dom to markdown lolololololol
function domdown(dom) {
if (dom.type === "tag") {
if (dom.name === "br") {
return " \n";
}
if (dom.name === "em") {
return "*" + ent.decode(dom.data) + "*\n";
}
{
"codes": [
{"code": 10, "description": "Collection needed", "status": 400},
{"code": 11, "description": "Timestamp needed", "status": 400},
{"code": 20, "description": "Invalid data type", "status": 409},
{"code": 30, "description": "Client not found", "status": 404},
{"code": 50, "description": "Invalid URL", "status": 403},
#!/usr/bin/env node
var express = require('express'),
db = require('mongojs').connect('mongodb://', ['db']),
routes = require('./routes')(db),
app = module.exports = express.createServer();
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
@deoxxa
deoxxa / README.md
Created March 17, 2012 02:47 — forked from rauchg/README.md
~/.js/github.com.js

github.com.js

dotjs userscript for visualizing package.json files (if present) underneath the tree view. Now with links to NPM for dependencies!

Very useful for navigating Node.JS projects

@deoxxa
deoxxa / pilot.js
Created February 18, 2012 05:45 — forked from dnoiz1/pilot.js
pilot object
var Pilot = function(data) {
this.charID = 0;
this.charName = null;
this.solarSystemID = null;
this.solarSystemName = null;
this.shipTypeID = null;
this.shipTypeName = null;
this.shipID = null;
this.shipName = null;
this.stationID = null;
<?php
$ip = "192.168.1.190"; // Minecraft IP
$port = "25566"; // Minecraft port
$fp = fsockopen($ip, $port, $errno, $errstr, 5); // Socket for connecting to server
if (!$fp) {
echo "Error";
} else {
$out = "\xFE"; // Hex needed for server info