This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/** | |
* Trying out different code approaches to break out of a | |
* deep callback chain in node.js | |
* | |
*/ | |
/** | |
* TEST #1 - Using a try/catch block | |
*/ | |
(function (throwError) { |
<!DOCTYPE html5> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Testing of Components</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script> | |
$(function() { | |
// benchmark async fetching of 10 files |
#!/bin/sh | |
DIFF=`ntpdate -q pool.ntp.org | awk '/offset ([-0-9\.]+) sec/ {i=int($10); print (i >= 0) ? i : 0 - i}'` | |
# set the date if the difference is > 10 seconds | |
if [ $DIFF -gt 10 ]; | |
then | |
echo -n "Time off by $DIFF seconds. Setting date ..." | |
sudo ntpdate pool.ntp.org | |
echo "one"; |
using System; | |
using System.Collections; | |
namespace CSharpFib | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
foreach (ulong x in Fibber(5)) { |
%% Write a function start(AnAtom, Fun) to register | |
%% AnAtom as spawn(Fun). Make sure your program | |
%% works correctly in the case when two parallel | |
%% processes simultaneously evaluate start/2. In | |
%% this case, you must guarantee that one of | |
%% these processes succeeds and the other fails. | |
-module(ch8prob1). | |
-export([start/2]). |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/a1b2c3d4e5f6g7h8i9/nonexistentfile.php | |
/ads/adxmlrpc.php | |
/Ads/adxmlrpc.php | |
/adserver/adxmlrpc.php | |
/adxmlrpc.php | |
/b2evo/xmlsrv/xmlrpc.php | |
/b2/xmlsrv/xmlrpc.php | |
/blogs/xmlrpc.php | |
/blogs/xmlsrv/xmlrpc.php | |
/blogtest/xmlsrv/xmlrpc.php |
ruby_block "sync_build_from_s3" do | |
action :nothing | |
block do | |
# latest_file contains path to the latest.txt, which lists files to sync | |
file = File.new(latest_file, "r"); | |
run_context = Chef::RunContext.new(node, {}) | |
# | |
# Create the directory to hold the new build files | |
# |
# Source accepts http/https or the protocol region:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
# Note resource name has changed from s3_file to s3_aware_remote_file | |
# for the eu-west-1 region: | |
s3_aware_remote_file "/var/bulk/the_file.tar.gz" do | |
source "s3-eu-west-1://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" |
object Application extends Controller { | |
/** | |
* Just display the home page. | |
*/ | |
def index = Action { implicit request => | |
Ok(views.html.index()) | |
} | |
/** |