Skip to content

Instantly share code, notes, and snippets.

View cyberwombat's full-sized avatar
🙄
Coding away the moments that make up a dull day

Yashua cyberwombat

🙄
Coding away the moments that make up a dull day
View GitHub Profile
@cyberwombat
cyberwombat / preview.js
Created May 25, 2016 19:36
Angular delayed image load directive
/*
* Angular directive to insert an image from a source that may require a few seconds
* to become available such as a thumb created by server to AWS S3.
* This directive checks if the image yields an error, if so it will loop a HEAD request
* every intevrval (default to 500ms, 5 times), If that fails then it will jus use the
* fallback image
* This directive will only peform an HTTP request when the initial loading image fails
*/
angular.module('app').directive('preview', function(stickerService, $http, $interval) {
return {
@cyberwombat
cyberwombat / gist:5321180
Created April 5, 2013 17:44
package.json
{
"name": "gonegreen",
"domains": [
"gonegreenstore.com",
"www.gonegreenstore.com"
],
"version": "0.0.0-69",
"dependencies": {
"express": ">= 3.0.0rc2",
"passport": "*",
@cyberwombat
cyberwombat / gist:5321157
Created April 5, 2013 17:41
Jitsu error
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: Error spawning drone: no matching engine found
error: Repository configuration
error:
error: This type of error is usually a user error.
error: Error output from Haibu:
error:
@cyberwombat
cyberwombat / imagemagick.js
Created November 13, 2012 16:30
Fix for NodeJS imagemagick module not parsing IM identify output
function parseIdentify(input) {
var lines = input.split("\n"),
prop = {},
props = [prop],
prevIndent = 0,
indent = 0,
indents = [indent],
currentLine, comps;
lines.shift(); //drop first line (Image: name.jpg)
@cyberwombat
cyberwombat / CORS Configuration
Created November 1, 2012 19:18
JQuery file upload plugin (blueimp) with NodeJs Express3 directly to Amazon S3 with public access
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>