Skip to content

Instantly share code, notes, and snippets.

View DTrejo's full-sized avatar

David Trejo DTrejo

View GitHub Profile
require 'sinatra'
require 'infusionsoft'
require 'logger'
Infusionsoft.configure do |config|
config.api_url = 'XXXX.infusionsoft.com'
config.api_key = 'XXXXXXXXXXXXXXX'
config.api_logger = Logger.new("./infusionsoft_api.log")
end
@DTrejo
DTrejo / npm_install_arbitrary_node_location.sh
Created April 24, 2011 06:44
npm_install_arbitrary_node_location.sh
# install npm on machines with node at arbitrary spot
# node is installed at some arbitrary path
echo '# npm paths' >> ~/.bashrc
echo 'export PATH=~/bin:~/local/share/man:$PATH' >> ~/.bashrc
echo 'export MANPATH=$MANPATH:~/local/share/man' # I think this may not work
. ~/.bashrc
cat <<NPMRC >>$HOME/.npmrc
root = ~/.node_libraries
manroot = ~/local/share/man
binroot = ~/bin
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@jed
jed / LICENSE.txt
Created May 10, 2011 14:44 — forked from 140bytes/LICENSE.txt
route client urls with 404s and pattern captures
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@jed
jed / LICENSE.txt
Created May 16, 2011 18:53 — forked from 140bytes/LICENSE.txt
scope
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@dscape
dscape / nodemailer-to-postmark.js
Created August 3, 2011 16:16
Make the postmark api look like node_mailer
var request = require('request')
, _ = require('underscore');
function send_mail(message, callback) {
if(typeof exports.SMTP.api_key !== "string") {
console.log(exports.SMTP)
callback(new Error("No API Key was given"));
return;
}
if(typeof exports.SMTP !== "object") {
#!/bin/sh
# Figure out what we are comparing to.
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=2ca2a592640b979a4092c19daa1938f9dd1baa46
fi
@max-mapper
max-mapper / server.js
Created December 10, 2011 03:52
foursquare irc bridge thingy
var crypto = require('crypto'),
fs = require("fs"),
https = require('https'),
http = require("http"),
sys = require('sys'),
request = require('request'),
url = require('url'),
querystring = require('querystring'),
tako = require('./tako'),
qs = require('querystring'),
anonymous
anonymous / server.js
Created January 5, 2012 08:34
var http = require('http');
var fs = require('fs');
var ip = '127.0.0.1';
var port = 2000;
var www = process.cwd();
var mimetypes = {'html': 'text/html', 'js': 'text/javascript', 'css': 'text/css', 'png': 'image/png', 'svg': 'image/svg'};
http.createServer(function (req, res) {
fs.realpath(www+req.url, function(err, realpath){
if (err || realpath.substr(0, www.length+1) != www+'/')
@mmalecki
mmalecki / analyze.js
Created January 7, 2012 23:57
A little script to analyze how many packages in `npm` have GitHub repositories
var registry = require('./registry');
console.log('Analyzing ' + registry.total_rows + ' rows');
var haveGithub = 0;
registry.rows.forEach(function (row) {
var doc = row.doc;
if (!doc['dist-tags'] || !doc['dist-tags'].latest) {
return console.error(doc.name + ' has no dist-tags');