THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
# Redirect STDOUT/STDERR into syslog | |
exec > >(logger -p user.info) 2> >(logger -p user.warn) |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Plupload - Getting Started: Chunking</title> | |
<script type="text/javascript" src="js/plupload.full.min.js"></script> | |
</head> |
<?php | |
if (empty($_FILES) || $_FILES['file']['error']) { | |
die('{"OK": 0, "info": "Failed to move uploaded file."}'); | |
} | |
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; | |
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0; | |
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"]; |
cpanm -l local https://github.com/<user_name>/<repo_name>/tarball/<branch_name> | |
e.g. | |
cpanm -l local https://github.com/issm/p5-Amon2-Plugin-Model/tarball/master |
// Demo: http://jsfiddle.net/pFaSx/ | |
// Create an invisible iframe | |
var iframe = document.createElement('iframe'); | |
iframe.id = "hacky-scrollbar-resize-listener"; | |
iframe.style.cssText = 'height: 0; background-color: transparent; margin: 0; padding: 0; overflow: hidden; border-width: 0; position: absolute; width: 100%;'; | |
// Register our event when the iframe loads | |
iframe.onload = function() { | |
// The trick here is that because this iframe has 100% width |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
/* | |
* helloglib.c | |
* Using glib libraries to do a hello world | |
* Compile with: | |
* gcc helloglib.c `pkg-config --cflags --libs glib-2.0` -o helloglib | |
*/ | |
#include <glib.h> | |
int | |
main (void) |
-- mathlib.lua | |
--[[ | |
Maths extension library for use in Corona SDK by Matthew Webster. | |
All work derived from referenced sources. | |
twitter: @horacebury | |
blog: http://springboardpillow.blogspot.co.uk/2012/04/sample-code.html | |
code exchange: http://code.coronalabs.com/search/node/HoraceBury | |
github: https://gist.github.com/HoraceBury |
#include <stdio.h> | |
void DumpHex(const void* data, size_t size) { | |
char ascii[17]; | |
size_t i, j; | |
ascii[16] = '\0'; | |
for (i = 0; i < size; ++i) { | |
printf("%02X ", ((unsigned char*)data)[i]); | |
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') { | |
ascii[i % 16] = ((unsigned char*)data)[i]; |
// This macro tests if a char is a continuation byte in utf8. | |
#define IS_CONT(x) (((x) & 0xc0) == 0x80) | |
// This returns the code point encoded at **s and advances *s to point to the | |
// next character. Thus it can easily be used in a loop. | |
int decode_code_point(char **s) { | |
int k = **s ? __builtin_clz(~(**s << 24)) : 0; // Count # of leading 1 bits. | |
int mask = (1 << (8 - k)) - 1; // All 1s with k leading 0s. | |
int value = **s & mask; | |
// k = 0 for one-byte code points; otherwise, k = #total bytes. |