Skip to content

Instantly share code, notes, and snippets.

View slickplaid's full-sized avatar

Evan slickplaid

View GitHub Profile
@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 / module1.js
Last active August 29, 2015 14:13
Question about Scope in Javascript
var module2 = require('./module2');
// will return the same exact output from console.log as inside the module
module2.function1();
module2.function2();
// If you want to get around this, you will want to pass the variables, or set them inside the proper scope
var module3 = require('./module3');
(function($){
$.fn.extend({
buildMenu: function(options) {
var defaults = {
limit: 3,
moreText: "More",
lessText: "Less",
numbers: true,
append: true,
@slickplaid
slickplaid / nodemon.error
Created February 21, 2011 19:35
nodemon@0.2.0 with node.js@0.4.1 error
$ nodemon
/home/slickplaid/.nvm/v0.4.1/bin/nodemon: line 1: syntax error near unexpected token `('
/home/slickplaid/.nvm/v0.4.1/bin/nodemon: line 1: `var fs = require('fs'),'
@slickplaid
slickplaid / html5video.html
Created May 12, 2011 22:28 — forked from beastaugh/html5video.html
HTML5 video, falling back to Flowplayer
<div id="video-1-container" class="video">
<video id="video-1" src="video/html5.mp4" width="480" height="204" controls>
<!-- HTML5 video, for compatible browsers -->
</video>
</div>
<script type="text/javascript">
Ojay.onDOMReady(function() {
// The video and the container need separate IDs to work around IE6's
// unwillingness to locate video elements.
@slickplaid
slickplaid / index.html
Created May 27, 2011 23:20
Simple example
<!-- put me in public/index.html -->
<!doctype html>
<html>
<head><title>Testing Express, Socket.io in Node.js</title></head>
<body>
<h1>Test!</h1>
<div class="m"></div>
<button>Send Message</button>
<!-- CHANGE to server hostname:port/socket.io/socket.io.js -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
module.exports.doSomething = function(redis){
redis.doSomethingWithRedis;
}
@slickplaid
slickplaid / config.json
Created June 3, 2011 23:11
Kohai Error
{
"config": {
"version": "v0.0.6",
"nick": "twitter",
"server": "irc.myserver.com",
"channels": [
"#twitter"
],
"plugins": {
"twitter": {
// core
var test = require('test');
test.bob();
// test file
var bob = require('bob');
var test = { bob: bob }
module.exports = test;
// bob file
@slickplaid
slickplaid / round-robin-proxy.js
Created June 9, 2011 23:38 — forked from indexzero/round-robin-proxy.js
A simple example of how to do round-robin proxying for a single domain
var httpProxy = require('http-proxy');
//
// Addresses to use in the round robin proxy
//
var addresses = [
{
host: 'ws1.0.0.0',
port: 80
},