Skip to content

Instantly share code, notes, and snippets.

<h2>App Academy ExpressJS Screencasts</h2>
<ul class="list-group">
<li><a href="http://vimeo.com/groups/appacademy/videos/88022112">1 - Module Exports</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88022113">2 - HTTP</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88022115">3 - Threads</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88022116">4 - Ruby IO Select</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88022119">5 - Ruby Event Reactor</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88025189">6 - Node Event Reactor</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88135357">7 - Express Routing</a></li>
<li><a href="http://vimeo.com/groups/appacademy/videos/88135358">8 - Express Next</a></li>
@jose8a
jose8a / NodeJS API Tutorial Sequence
Last active August 29, 2015 14:03
NodeJS API Tutorial Sequence
<li><a href="http://scottksmith.com/blog/2014/05/02/building-restful-apis-with-node/">RESTful API w/Node</a></li>
<li><a href="http://scottksmith.com/blog/2014/05/05/beer-locker-building-a-restful-api-with-node-crud/">RESTful API w/Node -- CRUD</a></li>
<li><a href="http://scottksmith.com/blog/2014/05/29/beer-locker-building-a-restful-api-with-node-passport/">RESTful API w/Node -- Passport</a></li>
<li><a href="http://scottksmith.com/blog/2014/07/02/beer-locker-building-a-restful-api-with-node-oauth2-server/">RESTful API w/Node -- OAuth2 Server</a></li>
<li><a href="http://scottksmith.com/blog/2014/09/14/beer-locker-building-a-restful-api-with-node-digest/">RESTful API w/Node -- Digest</a></li>
<li><a href="http://scottksmith.com/blog/2014/09/18/beer-locker-building-a-restful-api-with-node-username-and-password/">RESTful API w/Node -- Username and Password</a></li>
@jose8a
jose8a / NodeUpgrade
Last active August 29, 2015 14:04
How to Upgrade NodeJS ... e.g. as after a vulnerability/security patch
From: http://davidwalsh.name/upgrade-nodejs
Install n helper module via npm:
npm install n
Then do the following:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
@jose8a
jose8a / RailsDevTools
Last active August 29, 2015 14:05
Development Gems and Browser Extensions for Rails projects to improve productivity, access, and debugging
// documentation for installed gems:
gem server
// use railroady to generate model/controller uml diagrams
rake diagram:all
// updating a single gem at a time
http://ilikestuffblog.com/2012/07/01/you-should-update-one-gem-at-a-time-with-bundler-heres-how/
$> bundle update ––source GEMNAME
@jose8a
jose8a / AssociationMethods
Last active August 29, 2015 14:05
Rails: Methods gained via Associations
//***** ------- Order belongs_to Customer ==> methods gained:
@order.customer
@order.customer=
@order.build_customer(customer_number: 123, customer_name: "Joe Blow") --> only creates customer instance ... does not save!
@order.create_customer((customer_number: 123, customer_name: "Joe Blow") --> creates instance and saves it!
@order.create_customer!( ... ) --> raises error if record is not valid
//***** ------- Customer has_many Orders ==> methods gained:
@orders = @customer.orders
@jose8a
jose8a / RailsCheatsheet
Last active August 29, 2015 14:05 — forked from rstacruz/index.md
Cheatsheet for Ruby on Rails
# Misc Tips/Tricks
### Limit the size of your Rails Test/Dev Logs
https://www.stormconsultancy.co.uk/blog/development/tips-tricks/limit-the-size-of-your-rails-test-and-development-logs/
```
In your config/environments/test.rb and development.rb just add the line:
config.logger = Logger.new(config.paths['log'].first, 1, 50 * 1024 * 1024)
and your log files will never grow bigger than 50Mb. You can change the size to your own preference. The ‘1’ in the second parameter means that 1 historic log file will be kept, so you’ll have up to 100Mb of logs – the current log and the previous chunk of 50Mb.
@jose8a
jose8a / RailsAuthSetupGuide
Last active August 29, 2015 14:12
Adding Devise + OmniAuth to Rails 4 App
### This Guide is summary of steps outlined in the guide published by
### DigitalOcean here: https://www.digitalocean.com/community/tutorials/how-to-configure-devise-and-omniauth-for-your-rails-application
### TODO: automate this guide into a ruby script
### TODO: required auth tokens to be read from a local 'keys' folder w/individual
### PROVIDER (Twitter, FB, GH, Goog, etc.) token json files
X ----- [1] Add to Gemfile
gem 'therubyracer'
@jose8a
jose8a / Nokogiri---BrewUpdate Error Fix
Last active August 29, 2015 14:15
Error: Permission denied - /usr/local/Cellar/libiconv/1.14 when running brew upgrade. ==> possible solution
Original issue thread here: https://github.com/sparklemotion/nokogiri/issues/754
I know it's a long time after this issue was closed and I appreciate this is a libiconv / homebrew issue, but just in case others come this way just like me...
In the process of trying to get a zero warnings install of nokogiri on Mac OSX 10.9.3... I had the same problem as @geraldarthur upgrading from libiconv 1.13 to 1.14, namely:
Error: Permission denied - /usr/local/Cellar/libiconv/1.14 when running brew upgrade.
My kludge -
ls -l /usr/local/Cellar/ showed all directories except libiconv owned by me. libiconv owned by root and not otherwise writable. So permission denied not surprising.
$ ls -l /usr/local/Cellar/
@jose8a
jose8a / NPMDebuggingTips
Last active August 29, 2015 14:16
NPM debugging tips
https://github.com/npm/npm/wiki/Troubleshooting#if-your-npm-is-broken
https://docs.npmjs.com/misc/removing-npm
http://stackoverflow.com/questions/22562041/global-installation-with-npm-doesnt-work-after-mac-os-x-mavericks-update
@jose8a
jose8a / Bash_folder_iterating
Last active August 29, 2015 14:16
Iterating/recursing over files in a directory. 'Find' is more powerful and flexible.
#!/bin/bash
# Method #1: Recursive 'find' w/it's powerful -OPTIONS filtering
# and then piping the results to a 'while' command for performing
# multiple file-by-file actions.
#
# Only explore this folder level
# Only return "dotfiles"
find . -maxdepth 1 -name ".*" | while read fname; do
regex="^\./(\.[a-zA-Z0-9_]+)"