Chad Weider cweider
-
Twitter
- San Francisco, CA
- Sign in to view email
- blog.oofn.net
View HTMLString.js
var HTML_ENTITY_MAP = { | |
'&': '&' | |
, '<': '<' | |
, '>': '>' | |
, '"': '"' | |
, "'": ''' | |
, '/': '/' | |
}; | |
// OSWASP Guidlines: &, <, >, ", ' plus forward slash. |
View gist:2465637
// | |
// CTUIImage+Extensions.h | |
// MineSweeper | |
// | |
// Created by Chad Weider on 3/29/12. | |
// Copyright (c) 2012 Chad Weider. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
View gist:2460277
@implementation UIImage (CTUIImageExtensions) | |
+ (UIImage *)ct_imageWithPDFNamed:(NSString *)name size:(CGSize)size | |
{ | |
CGFloat scale = 1; | |
CGColorSpaceRef colorspace = NULL; | |
CGContextRef layerContext = NULL; | |
void *layerBytes = NULL; | |
CGPDFDocumentRef iconDocument = NULL; | |
CGImageRef cg_image = NULL; |
View gist:2394800
@media only screen and (-webkit-min-device-pixel-ratio: 2) { | |
img[src="images/icon.png"] { | |
content: url("images/icon@2x.png"); | |
} | |
img[src="images/store_small.png"] { | |
content: url("images/store_small@2x.png"); | |
} | |
img[src="images/screen_fail.png"] { | |
content: url("images/screen_fail@2x.png"); | |
} |
View gist:1871440
== iframeHTML | |
<!doctype html> | |
<html> | |
<head> | |
<%= INCLUDE_CSS %> | |
<%= INCLUDE_JS %> | |
<style type="text/css" title="dynamicsyntax"></style> | |
</head> | |
<body id="innerdocbody" class="syntax" spellcheck="false"> |
View yajsml
o /| | |
_ _ __ _ _ _ _ / | | |
/ / / | / _/| / / / / / | |
|__/ /\_/\/ /\_\/ / |_/_/ | |
___/_/ ___/_/ ________/___ | |
/__/ /__/ \__/ |
View gist:1659874
if (x == y) { | |
something_equal(); | |
} | |
else if (x < y) { | |
something_less(); | |
} | |
else { | |
something_great(); | |
} |
View gist:1618182
commit e42f039941e83fa54b615a472f244d3f971c8330 | |
Author: booo <borgers@mi.fu-berlin.de> | |
Date: Wed Dec 21 18:18:22 2011 +0100 | |
fix issue #281; remove white spaces | |
diff --git a/node/utils/Minify.js b/node/utils/Minify.js | |
index fd1dd07..70ccc15 100644 | |
--- a/node/utils/Minify.js | |
+++ b/node/utils/Minify.js |
View gist:262812
import random | |
import itertools | |
def bongo_sort(numbers): | |
for (smaller, larger) in itertools.izip(numbers, itertools.islice(numbers, 1, None)): | |
if larger < smaller: | |
random.shuffle(numbers) | |
return bongo_sort(numbers) | |
numbers = [4, 3, 2, 1] |