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 ruby | |
require 'rubygems' | |
require 'fog' | |
bucket_name = 'my_bucket' | |
object_name = 'big.zip' | |
# Part size must be between 5MB and 5GB. | |
# (http://docs.amazonwebservices.com/AmazonS3/latest/dev/qfacts.html) | |
# Let's say we've splitted the original file with split(1). |
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
# Basic: add a `gallery` attribute to the YAML header of any page with value | |
# being the extension of your images. Every image with that extension stored | |
# inside the page's directory (and every one of its subdirectories) will be | |
# added to the `gallery_items` attribute of that same page (alphabetically | |
# sorted). | |
module Jekyll | |
class Gallery < Generator | |
safe true |
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 'sinatra' | |
require 'csrf' | |
use Rack::Session::Cookie | |
apply_csrf_protection | |
# Here follow the route handlers. |
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 'capybara/rails' | |
require 'capybara/cucumber' |
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
location / { | |
root /my/web/site; | |
# Note (1) the '/' before $lang and (2) the lack of '/' before $uri (which | |
# already starts with '/'). | |
try_files /$lang$uri /$lang$uri.html /$lang$uri/ $uri $uri.html $uri/ =404; | |
} |
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
open /Applications/Install\ Xcode.app/Contents/Resources/Xcode.mpkg |
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 'active_support/time' | |
require 'aws-sdk' | |
threshold = 2.months.ago | |
ec2 = AWS::EC2.new | |
ec2.shapshots.with_owner(:self). | |
select {|s| s.volume_id == 'vol-12345678' && s.start_time < threshold}. | |
each {|s| puts "Bye-bye #{s.description}"; s.delete} |
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
# Clone of "Arduino UNO", without bootloader | |
unowithoutbl.name=Arduino Uno (w/o bootloader) | |
unowithoutbl.upload.maximum_size=32768 | |
unowithoutbl.bootloader.low_fuses=0xff | |
unowithoutbl.bootloader.high_fuses=0xdf | |
unowithoutbl.bootloader.extended_fuses=0x05 | |
unowithoutbl.bootloader.unlock_bits=0x3F | |
unowithoutbl.bootloader.lock_bits=0x0F | |
unowithoutbl.build.mcu=atmega328p | |
unowithoutbl.build.f_cpu=16000000L |
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
Atmega chip detector. | |
Entered programming mode OK. | |
Signature = 1E 97 05 | |
Processor = ATmega1284P | |
Flash memory size = 131072 | |
LFuse = 62 | |
HFuse = 99 | |
EFuse = FF | |
Lock byte = FF | |
Clock calibration = 81 |