Skip to content

Instantly share code, notes, and snippets.

View renaehodgkins's full-sized avatar

Renae Hodgkins renaehodgkins

View GitHub Profile
var rect = paper.rect(0, 0, 50, 50).rect.attr({fill: '#333'});
var rect = paper.rect(0, 0, 50, 50); // creat a rect with position and size, the coorrdinates are relative to the container
rect.attr({fill: '#333'}); // set the background color of the rect
var paper = Raphael(10, 50, 320, 200); // this line of code will generate a canvas at position x: 10, y: 50 with width 320, height 200
var paper = Raphael(element, 200, 100); // this will create canvas inside the html element
var paper = Raphael('container', 200, 100); // suppose you have a html element with id 'container'
#protip
add 'new-session' to your .tmux.conf -- then add 'tmux attach' to the end of your .bashrc/.profile/.zshrc or whatever to automatically connect or create a new session.
It's fucking rad.
https://img.skitch.com/20120320-drb6wifhbmy3n2137s2chymrn1.jpg
@renaehodgkins
renaehodgkins / cookie_fail
Created February 24, 2012 18:57
Cookie Fail
#social_header
line-height: 12px
float: right
font-family: "MuseoSans300"
font-size: 12px
color: #dee5e8
.social_hover
float: left
padding: 0px 2px
/* ----- Font Information -----
@font-face
font-family: "MuseoSans900"
src: url("/assets/museosans_900-webfont.eot")
src: local("☺"), url("/assets/museosans_900-webfont.woff") format("woff"), url("/assets/museosans_900-webfont.ttf") format("truetype"), url("/assets/museosans_900-webfont.svg#webfontl7P4kdU8") format("svg")
@font-face
font-family: "MuseoSans100"
@renaehodgkins
renaehodgkins / contact form
Created January 24, 2012 20:11
contact_form
jQuery(document).ready(function() {
validate_contact_form('#contact_form');
});
function validate_contact_form(form){
var validation_fields = ["#first_name", "#last_name", "#company", "#phone"];
jQuery.each(validation_fields, function(index, value){
$(form + ' ' + value).blur(function(){
validate_presence_of(this, form);

The html code snippet below is being stylized just with ````html (github flavored markdown allows to define a code snippet with four back ticks). Even though redcarpet renders the following correctly, coderay isn't adding style to it as html in my application.

<html>
  <head></head>
  <body>
    <div id='header'>
      <a href='#'>Rocky Road Blog</a>
    </div>
 
Unit tests should pass when run in random order. But for an existing legacy
project certain tests might depend on the execution order. One test might run
perfectly fine by itself, but fail miserably when run *after* another test.
Rather than running different combinations manually, RSpec 2.8 has the option
to run specs in random order with the `--order random` flag. But even with
this it can be hard to determine which specific test is causing the
dependency. For example:
rspec spec/controllers # succeeds
rspec spec/lib/my_lib_spec.rb # succeeds