This is now an actual repo:
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
# see http://www.fileslip.net/news/2010/02/04/language-id-project-the-basic-algorithm/ | |
from math import sqrt | |
you = {'pennies': 1, 'nickels': 2, 'dimes': 3, 'quarters': 4 } | |
me = {'pennies': 0, 'nickels': 3, 'dimes': 1, 'quarters': 1 } | |
abby = {'pennies': 2, 'nickels': 1, 'dimes': 0, 'quarters': 3 } |
This file contains 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 (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
This file contains 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
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-XXXXXX-X']); | |
_gaq.push(['_trackPageview']); | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
This file contains 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
/* | |
.d dP"Yb dP"Yb 88""Yb .d .d dP"Yb 88""Yb .d oP"Yb. 888888 88 88 88 88b 88 dP""b8 .dP"Y8 | |
.d88 dP Yb dP Yb 88__dP .d88 .d88 dP Yb 88__dP .d88 "' dP' 88 88 88 88 88Yb88 dP `" `Ybo." | |
88 Yb dP Yb dP 88"Yb 88 88 Yb dP 88"Yb 88 dP' 88 888888 88 88 Y88 Yb "88 o.`Y8b | |
88 YbodP YbodP 88 Yb 88 88 YbodP 88 Yb 88 .d8888 88 88 88 88 88 Y8 YboodP 8bodP' | |
88 88 888888 db 88""Yb 88b 88 888888 8888b. 888888 88""Yb dP"Yb 8b d8 |
This file contains 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
//Wait for relevant code bits to load before starting any tests | |
define(['core.js'], function( core ) { | |
module("Core Tests"); | |
test("Test core methods", function(){ | |
expect(2); | |
equals( 1, 1, "A trivial test"); | |
ok( true, "Another trivial test"); | |
}); |
This file contains 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
/** | |
* Asesses all of the events handlers bound on an View and makes touch event equivalents. | |
* | |
* Dependencies: Backbone, jQuery, Ben Alman's Outside Events jQuery plugin updated to support "touchstart" | |
* | |
* @param {Backbone.View} view | |
*/ | |
function touchify (view) { | |
_.each(view.events, function (value, key) { | |
_.each({'mouseleave': 'touchstartoutside', 'mouseenter': 'touchstart'}, function (eventValue, eventKey) { |
This file contains 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
# Credit: http://richardconroy.blogspot.com/2010/08/capybara-reference.html | |
#Navigating | |
visit('/projects') | |
visit(post_comments_path(post)) | |
#Clicking links and buttons | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') |
This file contains 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
// don't change these variables | |
var p = false; // currently playing | |
var e = false; // ended | |
var j = true; // first play | |
var videoTimeRaw = 0; | |
var currentTime = 0; | |
var defaultInterval = 100; | |
// configure these variables | |
var vidId = 'videoEmbed'; // the ID of the div holding the video |
This file contains 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
<?php | |
class My_Form_Template extends My_Form | |
{ | |
public function init() | |
{ | |
parent::init(); | |
$this->addElements(array( | |
$this->createElement(self::TYPE_MULTICHECKBOX, 'checks', array( |
OlderNewer