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
for f in *.html.md; do | |
ff="${f%.html.md}.md" | |
test -e "$f" || continue # possible when not using nullglob | |
test "$f" != "$ff" || continue # possible when using nocaseglob | |
if test -e "$ff" && | |
! test "$f" -ef "$ff"; then # possible on a case sensitive filesystem | |
echo "skipping <$f>: destination <$ff> exists and is distinct" 1>&2 | |
continue | |
fi |
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
package WWW::Pusher; | |
use warnings; | |
use strict; | |
use 5.008; | |
use JSON; | |
use URI; | |
use LWP::UserAgent; |
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
/* | |
Which one of the two `Get` method signatures should I go for? Or is there a better alternative? | |
The purpose of the `Get` method is to make a generic GET call to a REST API and hide away the authentication complexity. That's kind-of irrelevant here. | |
The 1st param in the call will always identify the resource | |
* Option 1: using `param KeyValuePair[]` so that multiple key value pairs can be passed to be convereted to name/value paris in a query string. | |
* Option 2: just uses an object created inline and can therefore have any keys/values it wants. But is it too magical? |
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
var request = require('request'); | |
var fs = require( 'fs' ); | |
var path = require('path'); | |
var WS_URL = 'http://api.ocrapiservice.com/1.0/rest/ocr'; | |
SO2(); | |
function SO2() { | |
var base64Str = fs.readFileSync( 'example.png' ).toString( 'base64' ); |
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
<?php | |
function http_file_get_contents( $url ) { | |
$response = file_get_contents( $url ); | |
return $response; | |
} | |
?> |
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
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-contrib' | |
gem 'pusher' |
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
com.pusher.define("com.pusher.test.framework", function(exports) { | |
/** | |
* Stub Pusher object. | |
*/ | |
var Pusher = function(appKey, options) { | |
Pusher.instances.push(this); | |
this.connection = new Connection(); | |
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
<?php | |
// https://github.com/squeeks/Pusher-PHP | |
require('squeeks-Pusher-PHP-0defb40/lib/Pusher.php'); | |
$key = 'APP_KEY'; | |
$secret = 'APP_SECRET'; | |
$app_id = 'APP_ID'; | |
$pusher = new Pusher($key, $secret, $app_id); | |
$channel_name = $_POST['channel_name']; |
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
<html> | |
<head> | |
<title> | |
jQuery v1.4.2 and jQuery tablesorter plugin sorting problem | |
</title> | |
</head> | |
<body> | |
<button id="add">Add Row</button> | |
<table class="tablesorter"> |
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
var fileLoader= { | |
require:function(s) { | |
try{ | |
// inserting via DOM fails in Safari 2.0, so brute force approach | |
if(s.type == "text/javascript") { | |
document.write('<script type="text/javascript" src="'+s.url+'"><\/script>'); | |
} else { | |
document.write('<link rel="stylesheet" href="'+ s.url +'" />'); | |
} | |
} catch(e) { |