- Rails: https://github.com/rails/pjax_rails
- Django: https://github.com/jacobian/django-pjax
- Asp.Net MVC3: http://biasecurities.com/blog/2011/using-pjax-with-asp-net-mvc3/
- FuelPHP: https://github.com/rcrowe/fuel-pjax
- Grails: http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/
- Express: https://github.com/abdelsaid/express-pjax-demo
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
require 'mechanize' | |
require 'yaml' | |
$results = [] | |
def find(a, link) | |
puts "find started on #{link}" | |
a.get link do |page| | |
page.search(:css, ".blog-post").each do |post| | |
h2 = post.search(:css, "h2").first |
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
class JobSchedule | |
# External interface for calling the service | |
def self.call(object_id, opts={}) | |
if perform_asynchronously? | |
Delayed::Job.enqueue(EnqueuedJob.new(name, object_id, opts)) | |
else | |
perform(object_id, opts) | |
end | |
end |
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
puts "What is the amount due?" | |
total = gets.chomp.to_f | |
puts "What is the amount tendered?" | |
paid = gets.chomp.to_f | |
if paid < total | |
puts "WARNING: Customer still owes $#{format("%.2f", total-paid)}" | |
puts Time.now | |
elsif paid > total |
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
Namespace = ( -> | |
merge = (target, source) -> | |
for key, val of source | |
target[key] = val | |
target | |
_assertValidFQN = (fqn) -> | |
unless ///^[a-z0-9_.]+///.test fqn then throw 'invalid namespace' | |
class Procedure |
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
<!-- http://emilsblog.lerch.org/2009/07/javascript-hacks-using-xhr-to-load.html --> | |
<html5> | |
<head> | |
<script language="vbscript"> | |
Function BinaryArrayToAscCSV( aBytes ) | |
Dim j, sOutput | |
sOutput = "BinaryArrayToAscCSV" | |
For j = 1 to LenB(aBytes) | |
sOutput= sOutput & AscB( MidB(aBytes,j,1) ) |
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 ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
url = ARGV[0] | |
code = ARGV[1] |
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
setInterval(function(){ | |
$('.content a').each(function() { | |
if (/\.(gif|jpe?g|png)/i.test($(this).text())) | |
$(this).html('<img src="'+$(this).text()+'"/>"') | |
}) | |
}, 1000) |
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
window.location = 'https://my.cl.ly' |
NewerOlder