$ chmod +x gem_component.sh # First make sure the script is executable
$ ./gen_component.sh Home
Which will create the following files:
# Ran into an issue recently where I wanted to use our custom prawn class to generate a PDF, then upload it to Amazon S3 using paperclip. | |
# Let 'OurCustomPdf' be our prawn class. | |
# Let the variable '@user' be our our model, has_many :documents | |
# Let 'Document' be our paperclip model, belongs_to :user | |
pdf = OurCustomPdf.new(@user, "pdf") | |
upload = @user.documents.new | |
upload.attachment = StringIO.new(pdf.render) | |
upload.save! | |
mkdir -p thumbs && ls *.mp4 | sed -e 's/\.mp4$//' | xargs -I '{}' -t ffmpeg -i '{}.mp4' -ss 00:00:01.000 -vframes 1 'thumbs/{}_thumb.png' && open thumbs |
# brew install nmap (if you're on OSX) | |
nmap --script smb-os-discovery -p 445 192.168.1.0/24 |
// Place your key bindings in this file to override the defaults | |
// TODO: Only in spec files, open terminal if one not open? | |
// NOTE: [ctrl+t] Run the currently focused rspec test file when the editor languageId is ruby | |
// NOTE: [ctrl+y] Run the rspec test file on the current line number under the cursor | |
[ | |
{ |
# Full Credit to Keybumps for putting together this list | |
# | |
# This script assumes you have ruby and the bundler gem installed | |
# | |
# ruby switch_scraper.rb | |
# | |
# Will write a switches.json file that is an array of switches | |
# with attributes model,feel,actuation,pre-travel,total-travel,mount | |
require 'bundler/inline' |