Skip to content

Instantly share code, notes, and snippets.

gotomypc / reverse-ip-lookup.js
Created Oct 27, 2012 — forked from eugenehp/reverse-ip-lookup.js
node.js IP reverse lookup
View reverse-ip-lookup.js
var dns = require('dns');
function reverseLookup(ip) {
if(err!=null) callback(err);
dns.lookup(domain,function(err, address, family){
gotomypc / image2base64.js
Created Oct 31, 2012 — forked from jfsiii/image2base64.js
Convert a remote image to Base64-encoded string
View image2base64.js
// Uses [request](
// /?url=
// /?uri=
// /?url=
// /?url=
var fs = require('fs');
var url = require('url');
var http = require('http');
var request = require('request');
gotomypc / load-generator.js
Created Nov 4, 2012 — forked from tkrueger/load-generator.js
generate and measure CPU load with node.js
View load-generator.js
#!/usr/bin/env node
var shouldRun = true;
var desiredLoadFactor = .5;
function blockCpuFor(ms) {
var now = new Date().getTime();
var result = 0
gotomypc / __request
Created Nov 5, 2012 — forked from natos/__request
Multiple Requests with Request (Node.js)
View __request
var request = require('request')
* Handle multiple requests at once
* @param urls [array]
* @param callback [function]
* @requires request module for node ( )
var __request = function (urls, callback) {
gotomypc /
Created Dec 1, 2012 — forked from javisantana/
real/fake gps
package hardware;
import java.util.ArrayList;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationProvider;
View redis_mysql_dump.js
// modules
var redis = require('redis');
var Step = require('step');
// config file
var config = require('config');
// mysql client connect
var mysql = require('mysql');
var connection = mysql.createConnection({
gotomypc / Websocket-speed-test.js
Created Nov 4, 2012 — forked from NHQ/Websocket-speed-test.js
Test how fast your browser handles websockets with Node.js.
View Websocket-speed-test.js
var server = require( 'http' ).createServer();
// our html template
var script = function( f ) {
// get just the content of this script
var s = /^[^\{]+\{\n?([\s\S]+)\}/.exec( f )[1];
return [
'<!DOCTYPE html><html>',
'<script type="text/javascript">',s,'</script>',
View javascript-prototyping-best-practices.js
'use strict';
# Javascript Prototyping Best Practices
* To create a class, create a constructor function with a `Name` and assign
it to a variable of the same `Name`.
* In this constructor only define properties using `this.prop` notation
gotomypc /
Created Oct 7, 2016 — forked from sethwebster/
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/ 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy: