Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'rubygems'
require 'flickraw'
# via http://www.valibuk.net/2010/03/access-flickr-with-ruby-and-flickraw/#comment-158964
id = "11104587@N07"
flickr.photos.search(:user_id => id)
puts "Your user ID is #{id}"
flickr.photos.search(:user_id => id, :tags => 'swift').each do |p|
#!/usr/bin/ruby
#This does what I need done when creating a new site on Ubuntu.
#you probably have different stuff here:
site_path = "/www/sites"
available_path = "/www/confs/sites-available"
enabled_path = "/www/confs/sites-enabled"
log_path = "/www/logs"
puts "==> Enter the domain you want to setup, without subdomains or TLDs (likethis):"
@cbfrance
cbfrance / 4636-style-checklist
Created November 5, 2010 22:30
Checklist for 4236 style deployment
Checklist for 4236 style deployment
From the crisismappers list
00: Define what you want to accomplish with this deployment -
consider it the "mission statement" part of the Mission 4636. Useful
for explaining to citizens, responders, press exactly what it is that
you are doing and will help clarify the design / implementation
process going forward.
@cbfrance
cbfrance / global gitignore
Created November 30, 2010 03:12
~/.global_ignore
# git config --global core.excludesfile ~/.global_ignore
#apple cruft
.DS_Store
.DS_Store?
Icon?
# Thumbnails
._*
@cbfrance
cbfrance / rainbow
Created January 1, 2011 07:20
viewport rainbows with @media conditions
# #!/usr/bin/ruby
rgb_value = 255
pixel_coordinate = rgb_value * 10
while pixel_coordinate > 0 do
print "@media only screen and (max-width: #{pixel_coordinate}px) { \n body { \n background-color: rgb(#{rgb_value},#{rgb_value},#{rgb_value}); } \n }\n"
(pixel_coordinate / 255) % 2 == 0 ? rgb_value += 1 : rgb_value -= 1
pixel_coordinate -= 1
end
@cbfrance
cbfrance / ahh
Created January 16, 2011 00:35
the joys of using compass: subtle shading with css3
@import "compass/css3";
$lightcolor: #ffffcc;
@include linear-gradient(color_stops($lightcolor,darken($lightcolor,5%)));
// ========================================================================================
// MARKUP
// div.row
// div.row_ar or div.row_en <------ (1 main language per row)
// div.column_ar and div.column_en <------ (2 language columns per row)
!meta_header_height = 55px
=headline_big_type(!from="right")
a
@cbfrance
cbfrance / taps via heroku gem
Created May 1, 2011 23:13
I think this convenience of moving databases with a one-liner is one of the things that made web development the most fun in 2010. I do this every day in ruby (taps gem and heroku gem) and php (drush).
[[email protected] ~/git/meedan-dev]
[(master)] >
$ heroku db:pull
Loaded Taps v0.3.23
Auto-detected local database: sqlite://db/development.sqlite3
Warning: Data in the database 'sqlite://db/development.sqlite3' will be overwritten and will not be recoverable.
! WARNING: Potentially Destructive Action
! This command will affect the app: meedan-dev
! To proceed, type "meedan-dev" or re-run this command with --confirm meedan-dev
@cbfrance
cbfrance / compass example
Created May 7, 2011 02:35
Nested pseudoclass selectors
li:first-of-type {
background: darken(yellow, 50%);
&::before {
content: "FIRST";
}
}
@cbfrance
cbfrance / layout.scss
Created June 29, 2011 23:05
Bidirectional layout
/*directional mixins*/
@import "base";
@import "welcome";
@import "announcement";
@import "favorites";
@import "tags";
@import "sidebar";
@import "nav";
@import "tabs";