This file contains hidden or 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/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 |
This file contains hidden or 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
# git config --global core.excludesfile ~/.global_ignore | |
#apple cruft | |
.DS_Store | |
.DS_Store? | |
Icon? | |
# Thumbnails | |
._* |
This file contains hidden or 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
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. |
This file contains hidden or 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/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):" |
This file contains hidden or 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/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| |
This file contains hidden or 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
if File.exist?('haiti.json.txt') | |
# parse the file | |
p "reading from the existing file ...." | |
jsonfile= File.open("haiti.json.txt", "r") | |
results= jsonfile.read | |
parsed_results= Crack::JSON.parse(results) | |
@incidents = parsed_results['payload']['incidents'] | |
pdf.bounding_box([x_pos, y_pos], :width => 300, :height => 400) do | |
@incidents.each do |i| |
This file contains hidden or 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
//this link creates a left-or-right aligned header link, like you might use on a blog post timestamp. | |
=wonky_link(!float = "left", !color="#333") | |
a.wrap | |
:text-decoration none | |
:line-height 15px | |
+columns(3,15) | |
:position absolute | |
:top 10px | |
:left 20px | |
:color #333 |
This file contains hidden or 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
<html> | |
<pre> | |
<code> | |
____ | |
___ .-~. /_"-._ | |
`-._~-. / /_ "~o\ :Y | |
\ \ / : \~x. ` ') | |
] Y / | Y< ~-.__j | |
/ ! _.--~T : l l< /.-~ | |
/ / ____.--~ . ` l /~\ \<|Y |
This file contains hidden or 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
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' |
This file contains hidden or 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
=chunkybacon(!yes = !green, !please_and= !light_grey) | |
+hover-link | |
+rounded | |
:padding 2px | |
:display block | |
:font-weight bold | |
:background = !please_and | |
:color= !please_and - !light_grey | |
&:hover | |
:background= !yes |