Skip to content

Instantly share code, notes, and snippets.

View albertpak's full-sized avatar

Albert Pak albertpak

View GitHub Profile
@albertpak
albertpak / gist:8894205
Last active August 29, 2015 13:56 — forked from teejayvanslyke/gist:2569284
Simply paste this snippet into your document ready block to get started, then on any links you'd like to track, simply provide the data-mixpanel-tracker attribute: Specify custom properties in JSON using the data-mixpanel-properties attribute: <a href="/moon" data-mixpanel-tracker="he chose to go to the moon" data-mixpanel-properties="{agency: '…
$('a[data-mixpanel-tracker]').click ->
setTimeout (=> window.location.href = $(@).attr('href')), 300
tracker = $(@).attr('data-mixpanel-tracker')
properties = JSON.parse($(@).attr('data-mixpanel-properties') || '{}')
mixpanel.track tracker, properties
return false
@albertpak
albertpak / Dev_tools
Created March 27, 2014 15:37
Links to useful tools for development
Alfred - http://alfredapp.com/
Moom - http://manytricks.com/moom
Sequel Pro - http://sequelpro.com/
iTerm 2 - http://iterm2.com/
PHPStorm - http://www.jetbrains.com/phpstorm/
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g
@albertpak
albertpak / rename_git_branch
Created February 23, 2015 17:42
Rename local and remote branch
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@albertpak
albertpak / app.rake
Last active August 29, 2015 14:19 — forked from ChuckJHardy/app.rake
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
@albertpak
albertpak / gist:5f3eea515ae96f508ab8
Last active September 1, 2015 18:41 — forked from olivierlacan/gist:4062929
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@albertpak
albertpak / fix_env_for_gemsets.sh
Last active September 18, 2015 18:16 — forked from brookr/gist:2493622
How to fix pow not using the correct gemset
# From the project root
rvm env -- `rvm current` >> .powenv
@albertpak
albertpak / ngrok_setup.sh
Created November 10, 2015 16:09
Setting up ngrok with rails - make sure that ports match
bin/rails s -p 3030 -b 127.0.0.1
~/ngrok http 3030
@albertpak
albertpak / AngularJS
Last active December 20, 2015 03:59
Links to AngularJS lessons, tutorials and useful material I'll be adding links in there as I come across useful information on AngularJS
http://angularjschicago.github.io/angular-tips-and-tricks
http://www.egghead.io
http://www.thinkster.io
http://briantford.com/blog/huuuuuge-angular-apps.html