Skip to content

Instantly share code, notes, and snippets.

function prepEsLinter() {
if [ -f "package.json" ]; then
echo "PackJSON alright there!!!"
else
echo "Creating a default package.json... might want to edit this!"
npm init -f
fi
(
export PKG=eslint-config-airbnb;
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"

The (Not-So-Good) Code-Along:

  • Students are simultaneously expected to:
    • listen to teacher talk
    • read code
    • copy down code
    • make suggestions
    • (maybe poorly defined expectations????)
@amadden80
amadden80 / reactToThis.md
Last active April 27, 2016 12:32
React To

Code Alongs


React To This Statement:

  • "From now on, the standard 'code along' has been banned. It is not to be used in-person or in dreams."

Now: React To This Statement:

var pics = document.getElementsByTagName('img');
for (var i=0; i<pics.length; i++){
pics[i].src = 'http://andrewmadden.com/face.png';
}
function messin(){
@amadden80
amadden80 / git-config.sh
Created November 13, 2015 13:32
Git Config
git config --global alias.lg 'log --oneline --decorate --graph'
git config --global alias.s 'status -s'

SQL is a thing

  • Does stuff
  • Brings back stuf

What do you do with it?

  • This thing!!!
@amadden80
amadden80 / angularErrors.html
Created September 12, 2015 17:36
My Common Angular Errors
// error: [ngRepeat:dupes]
// Can't have repeat values in an array because angular uses the values to index
// Consider:
<li ng-repeat="thing in things.allOfThem track by $index">
{{thing}}
</li>
@amadden80
amadden80 / Sinatra Boilerplate
Last active September 28, 2015 14:33
Sinatra Boilerplate Help
mkdir views models controllers config public public/css public/js
touch Gemfile config.ru Rakefile
touch config/database.yml
touch views/layout.erb views/index.erb
touch public/css/styles.css
touch public/js/scripts.js
echo "source 'https://rubygems.org'
gem 'sinatra'
echo "export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin" >> ~/.bash_profile
# awesome print
begin
require "awesome_print"
AwesomePrint.pry!
rescue LoadError => e
puts "ap gem not found."
if ( ENV['RAILS_ENV'] || defined? Rails )
puts "Try adding awesome_print to your Gemfile"
else
puts "Try typing 'gem install awesome_print' to get super-fancy output."