This file contains hidden or 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
module DelayedSingleton | |
# this first checks whether the same job has already been enqueued. | |
# if not, it enqueues it to run in one minute | |
def enqueue_singleton job, at = 1.minute.from_now | |
unless Delayed::Job.where(:handler => job.to_yaml).any? | |
Rails.logger.warn "enqueuing singleton job #{job.class.name}" | |
Delayed::Job.enqueue(job, run_at: at.getutc ) | |
end | |
end |
This file contains hidden or 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
<html> | |
<head> | |
<script data-main="index" src="require.js"></script> | |
</head> | |
<body></body> | |
</html> |
This file contains hidden or 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 ruby | |
## git-publish-branch: a simple script to ease the unnecessarily complex | |
## task of "publishing" a branch, i.e., taking a local branch, creating a | |
## reference to it on a remote repo, and setting up the local branch to | |
## track the remote one, all in one go. you can even delete that remote | |
## reference. | |
## | |
## Usage: git publish-branch [-d] <branch> [repository] | |
## |
This file contains hidden or 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 Modernizr.input.pattern | |
$(document).bind 'change', (e) -> | |
$el = $(e.target) | |
$el[0].setCustomValidity '' | |
if $el[0] in document.querySelectorAll(':invalid') | |
if message = $el.data('invalidmessage') | |
$el[0].setCustomValidity message |
This file contains hidden or 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
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script type="text/javascript" charset="utf-8" src="packery.pkgd.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
window.onload = function(){ | |
var debug = document.querySelector('#debugger'); | |
debug.innerHTML += "<h1>Hello</h1>"; | |
debug.innerHTML += Packery; |
This file contains hidden or 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
<html> | |
<body> | |
<img src="http://example.com/test.jpg?332534" /> | |
</body> | |
</html> |
This file contains hidden or 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 ruby | |
require 'optparse' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: example.rb [options]" | |
opts.on("-l", "--localdb DBNAME", "local DB name") do |ldb| | |
options[:local_db_name] = ldb |
This file contains hidden or 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
<div id="container" class="outline outline-big toggle-on-hover-switch"> | |
<b>.toggle-on-hover-switch</b> | |
<div id="out" class="outline toggle-on-hover-hide"> | |
<b>.toggle-on-hover-hide</b><br/> | |
I disappear. | |
I disappear. | |
I disappear. | |
I disappear. | |
</div> | |
<div id="in" class="outline toggle-on-hover-show"> |
This file contains hidden or 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
<a href="target" data-hovertext="Hover Text"> | |
Normal Text | |
</a> |
This file contains hidden or 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
Spree::CheckoutController.class_eval do | |
def ensure_checkout_allowed | |
check = @order.checkout_allowed? | |
unless check == true | |
redirect_to spree.cart_path, :flash => {:error => I18n.t("checkout_allowed_errors.#{check}")} | |
end | |
end | |
end |