Skip to content

Instantly share code, notes, and snippets.

View makenosound's full-sized avatar

Max Wheeler makenosound

View GitHub Profile
@makenosound
makenosound / async.rb
Created January 18, 2019 04:06 — forked from paul/async.rb
Implementations of useful step adapters for dry-transaction
# frozen_string_literal: true
module Tesseract
module Transaction
module Steps
# Executes the step in a background job. Argument is either an ActiveJob
# or another Transaction (or anything that implements `#perform_later`.
#
# If the provided transaction implements a `validate` step, then that
# validator will be called on the input before the job is enqueued. This
@makenosound
makenosound / app.js
Last active August 29, 2015 13:58 — forked from anonymous/app.js
Viewloader rewrite
var views = {
foo: function($el, el, props) {
console.log(props);
},
bar: function($el, el, props) {
console.log(props);
},
fooBar: function($el, el, props) {
console.log(props);
}
@makenosound
makenosound / preview.js
Created February 10, 2012 03:47 — forked from virginia/preview.js
Google Preview
$(document).ready(function() {
google.load("books", "0");
var viewerHeight;
var headerHeight;
var btn = $('#viewerButton'); // Single ref.
var viewer = $('#viewerContainer');
function viewerInit() {
@makenosound
makenosound / gist:1046087
Created June 25, 2011 03:10 — forked from liquorice/gist:1041979
bare bones method for grabbing and updating a users latest tweet (with no error handling whatsoever)
$.ajax({
url: 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=someonesplendid',
dataType: 'jsonp',
success: function(data) {
var tweet = data[0].text;
tweet = tweet.replace(/(http\:\/\/[A-Za-z0-9\.\/_]+)/g, '<a href="$1">$1</a>');
tweet = tweet.replace(/@([a-zA-Z0-9_]+)/g, '<a href="http://twitter.com/$1">@$1</a>');
$('#tweet').html(tweet);
}
});