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
# wordpress over fastcgi
server {
listen 81;
server_name _;
root /mnt/apps/airpair-blog/current;
index index.html index.php /index.php;
# restricting all dot files
location ~ /\. { return 403; }
#!/bin/bash
# Favicon and Apple Touch Icon Generator
#
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
#
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
# * apple-touch-icon-72x72-precomposed.png

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

var redis = require('redis')
, client = redis.createClient()
, assert = require('assert');
// redis.debug_mode = true;
client.on("error", function (err) {
console.log("Error " + err);
});
@DTrejo
DTrejo / server.js
Created January 5, 2012 08:41 — forked from anonymous/server.js
fixed :)
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'};
var path = require('path');
http.createServer(function (req, res) {
fs.realpath(path.join(www, req.url), function(err, realpath){
@DTrejo
DTrejo / node-and-npm-in-30-seconds.sh
Created November 13, 2011 21:45 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
// Routes
app.get('/', userIsAuthenticated, function(req, res){
Doc.find( { loc : { $near : [50.62, -20.32], $maxDistance : 50 } } , function (err, docs) {
res.render('index_authenticated.jade', {
locals: {
title: 'Welcome back to Gociety',
status: 'logged in',
currentUser: req.currentUser,
user: req.currentUser,
function findBeer(words) {
//...code...
getResults(word, function(err, result){
// now you can access things!
console.log(err, result);
});
}
function getResults(word, callback) {