Skip to content

Instantly share code, notes, and snippets.

View nasum's full-sized avatar
🏠
Working from home

Masaya Nasu nasum

🏠
Working from home
View GitHub Profile
@millermedeiros
millermedeiros / build.xml
Created February 13, 2011 20:57
RequireJS optimizer Ant task
<?xml version="1.0" encoding="utf-8"?>
<project name="sample-require-js" default="" basedir=".">
<!-- properties -->
<property name="r.js" value="_build/rjs/r.js" />
<property name="closure.jar" value="_build/closure/compiler.jar" />
<property name="rhino.jar" value="_build/rhino/js.jar" />
<property name="js.build" value="_build/js.build.js" />
<property name="css.build" value="_build/css.build.js" />
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@Craftworks
Craftworks / canvas_loading_icon.html
Created April 27, 2010 10:09
canvas loading icon
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
var LoadingIcon = function() { this.initialize.apply(this, arguments) };
LoadingIcon.prototype = {
initialize: function(rgb) {
var element = document.createElement('canvas'),
ctx = element.getContext('2d');
@hokaccha
hokaccha / gist:58594
Created February 5, 2009 07:26
wordbreak.js for jQuery
$(function(){
var $targetElement = '.wordBreak';
if($.browser.msie) {
$($targetElement).css('word-break', 'break-all');
} else {
$($targetElement).each(function(){
if(navigator.userAgent.indexOf('Firefox/2') != -1) {
$(this).html($(this).text().split('').join('<wbr />'));
} else {
$(this).html($(this).text().split('').join(String.fromCharCode(8203)));