Skip to content

Instantly share code, notes, and snippets.

context "after three guesses" do
it "should print the summary" do
@game.start(stub('generator' , :code => %w[r y g c]))
@game.guess(%w[b w y r])
@game.guess(%w[r y g g])
@game.guess(%w[r c y c])
@messenger.should_receive(:puts).with(<<-SUMMARY)
b w y r ww
r y g g bbb
r c y c bbw
Regex to match the following (JavaScript):
before
before {each:1,shared:1}
after
after {each:1,shared:1}
function bar()
{
}
bar.prototype.foo = function() {};
var x = new bar();
x.constructor ==> bar() // this seems correct
load('lib/env.js')
Envjs('fixtures/basedocument.html')
load('lib/jspec.js')
load('lib/jspec.xhr.js')
load('../public/js/jquery-1.4.2.min.js')
load('../public/js/Configurator.ServiceProxy.js')
JSpec.options.disableColors = true;
JSpec
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/jquery-ui-1.8.2.custom.css" />
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.2.custom.min.js"></script>
var scroller = new iScroll(document.getElementById('scroller'), {bounce: false});
$('select').bind('touchstart', function() {
scroller.destroy();
})
.bind('touchend', function()
{
scroller = new iScroll(document.getElementById('scroller'), {bounce: false);
})
.change(function(){
var myScroll;
var a = 0;
function loaded() {
setHeight(); // Set the wrapper height. Not strictly needed, see setHeight() function below.
// Please note that the following is the only line needed by iScroll to work.
// Everything else here is to make this demo fancier.
myScroll = new iScroll('content-scroller', {desktopCompatibility:true});
Vundle:
- Alternative package manager for VIM
- Install
- git clone into your .vim dir
- set rtp + call vundle#rc()
- Bundles to install are just setup in your .vimrc or other vim file
- Bundle "<name>" for packages from vimscripts
- Bundle "<git repo>" for github
- Bundle "<user/repo>" for github
- Managing bundles in this way is nice because it's one place to remove bundle
@swalke16
swalke16 / gist:1304628
Created October 21, 2011 18:51
Binding Provider
<html>
<head>
<script type='text/javascript' language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type='text/javascript' language="javascript" src="javascripts/knockout.js"></script>
<script type="text/html" id="contactTemplate">
<tr>
<td class='name'></td>
<td class='phone_number'></td>
</tr>
@swalke16
swalke16 / gist:cbc8fd10180d9d04d682
Last active July 20, 2017 14:38
Robot Controller Exercise

#Assignment:

Create a controller for a robot. The controller can respond to 4 commands corresponding to directions of movement (Forward, Back, Left, Right) and should maintain state of the current speed of travel.

Work in whatever language is comfortable for you. This is a test to see how you think about solving problems, not how well you know a specific technology. Show the results of your work either by writing unit tests, or making the controller interactive by accepting input and producing output to your medium of choice (console, web page, etc...).

Left
Forward