Skip to content

Instantly share code, notes, and snippets.

View kylesuss's full-sized avatar

Kyle Suss kylesuss

View GitHub Profile
cd /data/APPNAME/current && RAILS_ENV=staging /usr/local/bin/bundle exec /usr/local/bin/rake some:task
@kylesuss
kylesuss / EngineYard - Rails Console
Created September 3, 2013 22:56
Accessing the Rails console from Yard
cd /data/MyApp/current
ey_bundler_binstubs/rails c
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > 500) {
// do stuff
}
});
@mixin transition($property, $type, $seconds) {
-webkit-transition: $property $type $seconds;
-moz-transition: $property $type $seconds;
-o-transition: $property $type $seconds;
transition: $property $type $seconds;
}
@mixin gradient($top, $bottom) {
background-image: -webkit-linear-gradient($top, $bottom);
background-image: -moz-linear-gradient($top, $bottom);
background-image: -o-linear-gradient($top, $bottom);
text-shadow: 0px 1px 0px rgba(0,0,0,0.5);
array.inject(:+)
mysqld_safe
<script src="http://123.456.7.89:9000/target/target-script-min.js#anonymous"></script>
@kylesuss
kylesuss / OpenShift CLI
Last active December 26, 2015 15:39
How to create an app via the CLI for OpenShift
Run 'rhc create-app' to create your first application.
Do-It-Yourself 0.1 rhc create-app <app name> diy-0.1
JBoss Application Server 7 rhc create-app <app name> jbossas-7
JBoss Enterprise Application Platform 6.1.0 rhc create-app <app name> jbosseap-6
Jenkins Server rhc create-app <app name> jenkins-1
Node.js 0.10 rhc create-app <app name> nodejs-0.10
Node.js 0.6 rhc create-app <app name> nodejs-0.6
PHP 5.3 rhc create-app <app name> php-5.3
Perl 5.10 rhc create-app <app name> perl-5.10
@kylesuss
kylesuss / EngineYard - Sidekiq
Last active December 27, 2015 04:58
Using Sidekiq on EngineYard w/out Chef
# rails_root/deploy/before_restart.rb
# kill sidekiq processes
run "pkill [s]idekiq"
# rails_root/deploy/after_restart.rb
# restart sidekiq
# The & at the end tells Sidekiq to run in the background. It was necessary.
run "cd /data/APPNAME/current && sudo -u deploy RAILS_ENV=production /usr/local/bin/bundle exec sidekiq -e production -c 5 &"