An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
/** | |
* supplant() does variable substitution on the string. It scans through the string looking for | |
* expressions enclosed in { } braces. If an expression is found, use it as a key on the object, | |
* and if the key has a string value or number value, it is substituted for the bracket expression | |
* and it repeats. | |
* | |
* Written by Douglas Crockford | |
* http://www.crockford.com/ | |
*/ | |
String.prototype.supplant = function (o) { |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
# current_account.posts.visible_to(current_user) | |
module Visible | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def visible_to(person) | |
where \ | |
"(#{table_name}.bucket_id IN (?) AND | |
#{table_name}.bucket_type = 'Project') OR | |
(#{table_name}.bucket_id IN (?) AND |
$(function() { | |
initPage(); | |
}); | |
$(window).bind('page:change', function() { | |
initPage(); | |
}) |
apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev |
sudo update-rc.d unicorn defaults |
rvmsudo gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-head/ |
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("No password form :(.");})(); |
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 |
<h1><?php the_title() ?></h1> | |
<?php | |
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); | |
if ( $images ) : | |
?> | |
<?php foreach($images as $ima): ?> | |
<div class="gallery-thumb ev-gallery"> | |
<a rel="ev-gallery" class="size-thumbnail" href="<?php echo wp_get_attachment_url($ima->ID); ?>"><?php echo wp_get_attachment_image( $ima->ID, 'thumbnail' ); ?></a> |