A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
/** | |
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers | |
* @author ShirtlessKirk. Copyright (c) 2012. | |
* @license WTFPL (http://www.wtfpl.net/txt/copying) | |
*/ | |
var luhnChk = (function (arr) { | |
return function (ccNum) { | |
var | |
len = ccNum.length, | |
bit = 1, |
if (!window.Uint8ClampedArray && window.Uint8Array && window.ImageData) { | |
window.Uint8ClampedArray = function(input,arg1,arg2) { | |
var len = 0; | |
if (typeof input == "undefined") { } | |
else if (!isNaN(parseInt(input.length))) { //an array, yay | |
len = input.length; | |
} | |
else if (input instanceof ArrayBuffer) { | |
return new Uint8ClampedArray(new Uint8Array(input,arg1,arg2)); | |
} |
<?php | |
/** | |
* Make asynchronous requests to different resources as fast as possible and process the results as they are ready. | |
*/ | |
class Requests | |
{ | |
public $handle; | |
public function __construct() | |
{ |
So the Beaglebone uses the file uEnv.txt to store settings as it doesn't have any NAND allocated to do it with, by | |
default the file is pretty empty save from the line: | |
optargs=run_hardware_tests quiet | |
You may have read a number of things about boot.scr etc - ignore it, it's not correct. | |
The bootcmd is hardwired in uboot to do the following (i've seperated it all out to make things clearer) - you can see it by | |
interrupting the bootsequence and performing a 'printenv'. | |
bootcmd= |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.
However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P
They say the following about their Captcha:
<?php | |
$x = function($bar, $foo="9") { | |
echo $foo, $bar, "\n"; | |
}; | |
class MissingArgumentException extends Exception { | |
} | |
function call_user_func_named_array($method, $arr){ |
a = new Array(); | |
for (var b = 0; b < 10; b++) { | |
a[0] |= b; | |
} | |
a = new Array(); | |
a[0] = 0; // just this change alone make code 2x faster | |
for (var b = 0; b < 10; b++) { | |
a[0] |= b; |
#include <stdio.h> | |
#include <algorithm> | |
#include <vector> | |
struct State | |
{ | |
int answer; | |
int where; | |
bool calculated; | |
State() : answer(0), where(0), calculated( false ) {} |
There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.
Get a Linode VM in the UK. The 512MB server for $20 works just fine. (If you want to use my referral link, go for it: http://bit.ly/OuzdVe)
Follow the standard OpenVPN installation documentation. (Basically, 'apt-get install openvpn' or 'yum install openvpn' and then follow these docs: http://openvpn.net/index.php/open-source/documentation/howto.html). For an OS X client, I prefer Viscosity: http://www.thesparklabs