Skip to content

Instantly share code, notes, and snippets.

View slickplaid's full-sized avatar

Evan slickplaid

View GitHub Profile
@slickplaid
slickplaid / zillowEstimate.js
Last active January 16, 2020 05:25
Get Zillow Estimate and Image from Zillow's API, Quick and Dirty
/* Quick and dirty, should be wrapped better but this is just a demo */
var app = app || {};
app.apikeys = app.apikeys || {};
app.urls = app.urls || {};
app.methods = app.methods || {};
app.apikeys.zillow = 'YOUR API KEY HERE';
app.urls.zillow = {
@slickplaid
slickplaid / install.sh
Last active August 29, 2015 14:04
Install Payroll Managers
#!/bin/bash
if [[ $EUID -eq 0 ]]; then
error "This script should not be run using sudo or as the root user."
exit 1
fi
command -v curl >/dev/null 2>&1 || { echo >&2 "Curl is required to install NVM. Install it using 'sudo apt-get install curl' on Ubuntu. Aborting."; exit 1; }
command -v git >/dev/null 2>&1 || { echo >&2 "Git is required to clone the code structure. Install it using 'sudo apt-get install git' on Ubuntu. Aborting."; exit 1; }
@slickplaid
slickplaid / upapt.sh
Created July 23, 2014 20:41
Rackspace Ubuntu Server - Allow older system to get updates using apt with Rackspace's Mirrors
sudo sed -i -e 's/mirror.rackspace.com\|archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
@slickplaid
slickplaid / install_wkhtmltopdf.sh
Last active September 11, 2022 12:51
How to install version 0.12.0 (latest as of 5/10/13) of wkhtmltopdf on Ubuntu 12.04 LTS headless server.
sudo apt-get update && sudo apt-get upgrade -y;
sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit;
sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools;
cd ~;
git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt;
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf;
cd wkhtmltopdf;
qmake-qt4;
cd ../wkhtmltopdf-qt;
git checkout 4.8.4;
@slickplaid
slickplaid / fancybox.fix.js
Created February 19, 2013 02:08
Fix for namberjuice.com fancybox cross domain XHR issue.
$mtkb('.fancybox').fancybox(
{
hideOnContentClick : true,
width: 382,
autoDimensions: true,
type : 'iframe',
showTitle: false,
scrolling: 'no',
onComplete: function(){
@slickplaid
slickplaid / manual.pdftotext.js
Created February 12, 2013 18:48
PDFTOTEXT Node.js Example
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
var fs = require('fs');
/**
* @param pdf_path path to the single page searchable pdf file on disk
* This function buffers all the output from stdout and sends it back as a string.
* Since we only handle single pages of pdf text here the amount of text is small
* and therefore we don't need to use a stream
@slickplaid
slickplaid / test.js
Created November 15, 2012 17:26
Client/Scenario Testing
var fs = require('fs');
var file = fs.readFileSync('./file/location/here.json');
file = JSON.parse(file); // this needs to be valid json or it will throw an error
var Client = require('./location/of/models/clients.js');
var output = new Client(file);
console.log(output);
// or if you're doing a scenario
var Scenario = require('./location/of/models/scenarios.js');
@slickplaid
slickplaid / app.js
Created November 15, 2012 00:39
AppJS - Express Integration
var regex = /^http:\/\/appjs/;
appjs.router.handle = function(req, res, next) {
req.url = req.url.replace(regex, '');
app.handle.apply(app, arguments);
}
@slickplaid
slickplaid / controller.js
Created August 31, 2012 14:15
Formidable Errors
app.get('/admin/uploads', authenticateUser, isAdmin, function(req, res) {
res.render('admin/upload');
});
app.post('/admin/uploads', authenticateUser, isAdmin, function(req, res) {
var format = require('util').format;
console.log(format, req.files.upload.name);
res.send(format('\nuploaded %s (%d Kb) to %s as %s'
, req.files.upload.name
, req.files.upload.size / 1024 | 0
@slickplaid
slickplaid / .gitignore
Created August 7, 2012 20:00
Multi-domain Socket.io
node_modules/