Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
; Reference - https://www.mpselectmini.com/starting_ending_g-code_scripts | |
M400 ; wait for pending commands to finish | |
M104 S0 ; turn off hotend/extruder heater | |
M140 S0 ; turn off bed heater | |
G91 ; set to relative positioning | |
G1 E-2 F300 ; retract the filament a bit before lifting the nozzle to release some of the pressure | |
G1 Z1 ; raise Z 1mm from current position | |
G1 E-2 F300 ; retract filament even more | |
G90 ; set to absolute positioning | |
G1 X20 ; move X axis close to tower but hopefully far enough to keep the fan from rattling |
... | |
def csrf_meta_tags | |
render layout: false | |
end | |
... |
.fa-bounce { | |
display: inline-block; | |
position: relative; | |
-moz-animation: bounce 1s infinite linear; | |
-o-animation: bounce 1s infinite linear; | |
-webkit-animation: bounce 1s infinite linear; | |
animation: bounce 1s infinite linear; | |
} | |
@-webkit-keyframes bounce { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Dear [First Name], | |
We're really sorry but our systems were compromised and the attackers managed to take a copy | |
of your passwords. | |
The passwords were stored as: | |
[ ] Bcrypt hashes with a cost factor of X | |
[ ] PBKDF2 hashes with an iteration count of X | |
[ ] scrypt because I am Colin Percival |
var banned_sites = ['Bits', 'Forbes.com', 'TechCrunch', 'PCWorld', 'AllThingsD']; | |
var banned_tags = ['Venture Capital', 'Social', 'Startups', 'PHP', 'Social Media']; | |
var banned_words = ['Node', 'PHP', 'Zend', 'Cloud']; | |
var scrubber = function(){ | |
$('.article').each(function(index, object){ | |
var hideit = false; | |
var publisher = $(object).find('.publisher').find('.interest').text(); |
I like Rdio and linux. Rdio works great in a browser except for one thing: keyboard shortcuts!!!
When coding, I like to be able to play/pause my music quickly, meaning I don't want to switch windows. I figured out a way to do this:
First, I made a file in my ~/bin
called rdio
that runs:
google-chrome --app=http://rdio.com
# app/models/my_model.rb | |
module MyApp | |
module Model | |
def self.included(base) | |
base.send :include, Mongoid::Document | |
base.send :include, Mongoid::Timestamps | |
base.send :include, ActiveAdmin::Mongoid::Patches | |
end | |
end |
namespace :deploy do | |
desc "Deploy to Heroku" | |
task :heroku do | |
Rake::Task["deploy:precompile_assets_and_upload_to_s3"].invoke | |
Rake::Task["deploy:push_heroku"].invoke | |
end | |
desc "Precompile assets and upload to s3" | |
task :precompile_assets_and_upload_to_s3 do | |
storage = Fog::Storage.new :provider => 'AWS', :aws_access_key_id => "123", :aws_secret_access_key => "123" |
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config. | |
# Then add the classes your want to migrate in the klasses array below. | |
# Then run rake paperclip_migration:migrate_to_s3 | |
# Should work but this is untested and may need some tweaking - but it did the job for me. | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
klasses = [:model_1, :model_2] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration. | |
klasses.each do |klass_key| |