This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread.new do | |
# Do this in a new thread so that the loop can run at the same time as gets (the latter waits until a newline is entered) | |
until gets.chomp == "stop"; end | |
# Exit the entire program (this only stops the current thread in IRB, I warn you) | |
exit | |
end | |
puts "Program started" | |
loop do | |
sleep 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'rspec', :spec_paths => ['spec/models', 'spec/workers', 'spec/observers'] do | |
# ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML | |
===== | |
<script type='text/javascript'> | |
window.jQuery || document.write('<script src="js/jquery-1.7.1.js">\x3C/script>') | |
</script> | |
<script src='http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js' type='text/javascript'></script> | |
<script type='text/javascript'> | |
window.Modernizr || document.write('<script src="js/modernizr-2.0.6.js">\x3C/script>') | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
# Please modify the CONSTANT variables to fit your configurations. | |
# The script will start with config set by $PUMA_CONFIG_FILE by default | |
PUMA_CONFIG_FILE=config/puma.rb | |
PUMA_PID_FILE=tmp/pids/puma.pid | |
PUMA_SOCKET=tmp/sockets/puma.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ignore([ | |
%r{^bin/*}, | |
%r{^config/*}, | |
%r{^db/*}, | |
# %r{^lib/*}, | |
%r{^log/*}, | |
%r{^public/*}, | |
%r{^tmp/*} | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## I imagine this could be done in the migration, but it was giving me problems so I moved it to the model | |
## and just did it on the command line | |
> Tag.reset_questions_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rename 's/\.[^.]*$/.slim/' app/views/devise/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails generate model Image name:string imageable:references{polymorphic} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill $(ps aux | grep 'puma' | awk '{print $2}') | |
# The ps gives you the list of all the processes. | |
# The grep filters that based on your search string, [p] is a trick to stop you picking up the actual grep process itself. | |
# The awk just gives you the second field of each line, which is the PID. | |
# The $(x) construct means to execute x then take its output and put it on the command line. The output of that ps pipeline inside # that construct above is the list of process IDs so you end up with a command like kill 1234 1122 7654 |
OlderNewer