Skip to content

Instantly share code, notes, and snippets.

View fortil's full-sized avatar
🎯
Focusing

William Penagos fortil

🎯
Focusing
View GitHub Profile
@monokrome
monokrome / s3_anon.policy
Created June 4, 2012 05:38
Allowing anonymous access to files on S3.
{
"Id": "Policy<ENTER_RANDOM_NUMBERS_HERE>",
"Statement": [
{
"Sid": "Stmt<ENTER_RANDOM_NUMBERS_HERE>",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::your.bucket.name/*",
@fermuch
fermuch / hexconverter.js
Created January 17, 2012 13:58
Library for Hexadecimal working with Javascript. I based this on a lib that I found in a blog, but I don't remember the blog, so I'm sorry.
var HexConverter = {
hexDigits : '0123456789ABCDEF',
dec2hex : function( dec )
{
return( this.hexDigits[ dec >> 4 ] + this.hexDigits[ dec & 15 ] );
},
hex2dec : function( hex )
{
@borismus
borismus / gist:1032746
Created June 18, 2011 02:46
Convert a base64 string into a binary Uint8 Array
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {