Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
loading...

Eddy Hernandez eddywashere

🔥
loading...
View GitHub Profile
View ruby.md

if

if tweets.empty?
  puts "no tweets found - better follow some ppl!"
end

# inline
puts "no tweets found - better follow some ppl!" if tweets.empty?
@eddywashere
eddywashere / mongo-on-startup.md
Last active Aug 29, 2015
Run mongod with some decent settings on startup
View mongo-on-startup.md

Create the mongod.conf and insert the config content.

sudo vim /usr/local/var/mongodb/mongod.conf

Grab the path to mongod. which mongod

Create the org.mongo.mongod.plist file and insert the plist content and update the path to mongod.

View highlight.scss
code {
font-family:'Bitstream Vera Sans Mono','Courier', monospace;
}
.highlight .c { color: #586E75 } /* Comment */
.highlight .err { color: #93A1A1 } /* Error */
.highlight .g { color: #93A1A1 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #93A1A1 } /* Literal */
.highlight .n { color: #93A1A1 } /* Name */
@eddywashere
eddywashere / Vagrantfile
Last active Aug 29, 2015
sample node + mongodb file
View Vagrantfile
$install_script = <<SCRIPT
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get install -y mongodb-10gen
curl -L https://get.rvm.io | bash -s stable --ruby=2.1.1
source /home/vagrant/.rvm/scripts/rvm
gem install bundler
cd /sage && bundle install && npm install -g bower grunt-cli
SCRIPT
@eddywashere
eddywashere / example.md
Last active Aug 29, 2015
Send Rackspace Load Balancer Logs to Loggly or console output with node.js
View example.md

Create a directory for this project and install the dependencies.

npm install adm-zip loggly

Download the log files for Rackspace Cloud Load Balancers from the Cloud Files container, ex: lb_123456_lb-name_Sep_2014.

Then, create an examples directory and put the zipped log files there.

@eddywashere
eddywashere / respond-middleware.md
Last active Aug 29, 2015
render & redirect helper middleware
View respond-middleware.md

Example usage:

This middleware uses the request object to set arbitrary data available at either req.render or req.redirect;

routes.js

var setRedirect = require('respond-middleware').redirect;
var setRender  = require('respond-middleware').render;
View gist:3a4faf776d4c7be5e0a5
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
svn info >/dev/null 2>/dev/null && echo 'ಠ_ಠ' && return
echo '○'
}
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
View keybase.md

Keybase proof

I hereby claim:

  • I am eddywashere on github.
  • I am eddywashere (https://keybase.io/eddywashere) on keybase.
  • I have a public key whose fingerprint is E3A1 3169 9CFE ED81 7DD1 A11A 7C57 AE5F 3EC5 FE34

To claim this, I am signing this object:

@eddywashere
eddywashere / nodeinstall.md
Last active Oct 8, 2015
Install nodejs for a local user with git
View nodeinstall.md

setup directory and clone from githhub

mkdir ~/.local

cd ~/.local

git clone https://github.com/joyent/node.git

cd node
@eddywashere
eddywashere / html5boilerplate.jade
Created Nov 11, 2012 — forked from xtian/html5boilerplate.jade
HTML5 Boilerplate in jade
View html5boilerplate.jade
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
//[if gt IE 8]><!
html(class='no-js')
//<![endif]