This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | |
<script src="http://yandex.st/raphael/1.5.2/raphael.min.js"></script> | |
<script> | |
/** | |
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery | |
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license | |
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cocoapods Notes | |
## For XCode 5 Dev Preview on Mavericks | |
If your dynamic frameworks in the Pods project are getting linked to OSX Frameworks instead of iOS, you can try reverting to an earlier version of Cocoapods (0.24.0) | |
- This is more of an XCode UI bug, than a real build problem, but at this point in time there is no work around in Cocoapods. Original Source: https://github.com/CocoaPods/CocoaPods/issues/1420#issuecomment-25561488 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl $(strings /System/Library/PrivateFrameworks/SoftwareUpdate.framework/SoftwareUpdate | grep http | grep sucatalog) | grep Safari6 | grep pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a back reference to Unknown kinds in a one-to-many model (from Guido Van Rossum) | |
# Source: http://stackoverflow.com/questions/10731433/following-backreferences-of-unknown-kinds-in-ndb | |
class LinkedKeyProperty(ndb.KeyProperty): | |
def _fix_up(self, cls, code_name): | |
super(LinkedKeyProperty, self)._fix_up(cls, code_name) | |
modelclass = ndb.Model._kind_map[self._kind] | |
collection_name = '%s_ref_%s_to_%s' % (cls.__name__, | |
code_name, | |
modelclass.__name__) | |
setattr(modelclass, collection_name, (cls, self)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
var bookmarklet = { | |
bootstrap: function() { | |
var self = this; | |
if (!window.jQuery) { | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"; | |
script.async = true; | |
script.type = "text/javascript"; | |
script.onload = function() { self.parse(); }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add 10px of transparency canvas to all PNGs in this dir - renamed padded-ORIGNAME.png | |
`convert *.png -matte -bordercolor none -border 10 -set filename:fname '%t' 'padded-%[filename:fname].png'` | |
# Compress JPEGs at desired quality (1-100) | |
`convert *.jpg -quality 85 -set filename:fname '%t' 'compressed-%[filename:fname].jpg'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Elegant composition | |
// src: http://news.ycombinator.com/item?id=3512011 | |
function compose(funcA, funcB){ | |
return function(x, result, error){ | |
// Data flows right-to-left over composition, so "do x, then do y" | |
// is written: "do y" o "do x" | |
funcB(x, function(x_){ funcA(x_, result, error) }, error); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Factory{ | |
public static function create($name){ | |
if(class_exists($name, TRUE)){ | |
return new $name; | |
}else{ | |
throw new IllegalArgumentException("$name is not an invalid or unknown type"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple video sample</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script type="text/javascript" src="http://html5.kaltura.org/js" ></script> | |
</head> | |
<body> | |
<video id="vid1" width="480" height="267" durationHint="02:32"> |
NewerOlder