Skip to content

Instantly share code, notes, and snippets.

View mdmartinez's full-sized avatar
🎯
Focusing

Daniel Martinez mdmartinez

🎯
Focusing
View GitHub Profile
@mdmartinez
mdmartinez / Heroku Commands
Created April 20, 2015 19:03
Heroku Commands
# runs console for AR queries
heroku run console --app gamefinder
# runs psql environment
heroku pg:psql -a gamefinder
# gives you config environment variables
heroku config -a gamefinder
# resets database on heroku
@mdmartinez
mdmartinez / Set ENV variables OSX
Created July 8, 2015 12:51
Set ENV variables OSX
Locally
export variable=value
Globally
To set an environment variable, enter the following command:
launchctl setenv variable "value"
To find out if an environment variable is set, use the following command:
## Fresh App Stuff
rails new myapp --database=postgresql -T
## Gemfile add: rspec, factory_girl, capybara, bcrypt
gem 'rspec-rails', '~> 3.0'
## Delete all references to turbolinks
Bundle
rails g rspec:install
# Testing
@mdmartinez
mdmartinez / gist:9dd0e0cb79d1892bffd7
Last active January 20, 2018 16:23
Sublime Reminder
control + command + up/down moves an entire line
hold command and click multiple times for multiple cursors
command T can create a new tab from a file
command P jumps to search text in a file
commmand shift F searches entire app
when coping all files and folders, use cp -R <current_directory> <new_directory>

grep -v "example" // This will match everything EXCEPT "example"

awk "/example/" // Use awk when you want to do regex. This will match "example"

var bar = “Baz”;
foo(); // => TypeError: undefined is not a function
var foo = function() {
console.log(“Hello ” + bar);
};
var bar = "Baz";
foo(); // => Hello Baz
function foo() {
console.log("Hello " + bar);
};
var Foo = function() {
var _bar = “baz”;
}
var Foo = function() {
var bar = “baz”;
}