Skip to content

Instantly share code, notes, and snippets.

View eddywashere's full-sized avatar
🔥
loading...

Eddy Hernandez eddywashere

🔥
loading...
View GitHub Profile
@eddywashere
eddywashere / gist:7575099
Created November 21, 2013 02:25
js snippet for outputting stylesheets, rule count and selector count
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length;
for (var j = 0; j < totalStyleSheets; j++){
var
styleSheet = styleSheets[j],
rules = styleSheet.cssRules,
totalRulesInStylesheet = rules.length,
totalSelectorsInStylesheet = 0;
@eddywashere
eddywashere / .gitignore
Created January 7, 2014 18:52
global .gitignore file
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
/db/*.sqlite3
/log/*.log
@eddywashere
eddywashere / ruby.md
Created March 13, 2014 23:03
old ruby notes

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?
/* Custom styles for Confluence (included for all themes by default) */
/*****************************************************
** PUT SPACE SPECIFIC STYLING HERE (NOT AT BOTTOM)
***************************************************/
#children-section
{
display : none;
@eddywashere
eddywashere / mongo-on-startup.md
Last active August 29, 2015 14:02
Run mongod with some decent settings on startup

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.

@eddywashere
eddywashere / example-alarm.json
Created June 18, 2014 05:10
Example webhook data from Rackspace Cloud Monitoring
{
"event_id": "12345678910:1403052700000:OK",
"log_entry_id": "123456789101234567891012345678910",
"details": {
"target": "rackspace.com",
"timestamp": 1403052704485,
"metrics": {
"duration": {
"type": "I",
"data": 240,

by.model

<input type="text" ng-model="yourName">

// by.model('yourName')

by.binding

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 August 29, 2015 14:05
sample node + mongodb file
$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 August 29, 2015 14:06
Send Rackspace Load Balancer Logs to Loggly or console output with node.js

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.