Skip to content

Instantly share code, notes, and snippets.

View ryankshaw's full-sized avatar

Ryan Shaw ryankshaw

  • Instructure
  • Utah
View GitHub Profile

When a beginner asks you "when do I use semi-colons?" would you rather say this?

// what people who say "use semicolons!!" say
class Foo {
  prop = {
  }; // yes
<span
ng-click="add()"
class="icon icon__plus"
>Hello World!</span>
#Run with casperjs test translate.coffee
casper.start 'http://translate.google.com/', ->
@sendKeys '#source', 'Guten Tag'
@then ->
@click '#gt-submit'
@waitForText 'Good day'
@then ->
@test.assertSelectorHasText '#result_box', 'Good day'
@then ->
@ryankshaw
ryankshaw / hidden_grades.js
Created September 6, 2011 22:00 — forked from tommetge/hidden_grades.js
hiding grades in canvas
/* Note that this does not disable viewing of grades, it simply
hides them from the students. As such, this is certainly not
bullet-proof: a smart and dedicated person will be able to
expose grades.
Given the above, it is recommended that institutions simply
wait for the official hidden grade functionality in Canvas. */
// this syntax is like $(document).ready but also works if the 'ready' event has already fired
jQuery(function($){
@ryankshaw
ryankshaw / gist:745234
Created December 17, 2010 16:37 — forked from zwily/gist:745204
$(function() {
setInterval(function() {
$(".reloadable").each(function(i) {
var originalSrc = $(this).data('originalSrc');
if (!originalSrc) {
originalSrc = $(this).attr('src');
$(this).data('originalSrc', originalSrc);
}
$(this).attr('src', originalSrc + '&hack=' + (new Date().getTime()));
});
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');