Skip to content

Instantly share code, notes, and snippets.

View secretrobotron's full-sized avatar
🙀
wow!

Bobby Richter secretrobotron

🙀
wow!
View GitHub Profile
@secretrobotron
secretrobotron / custom-element-thimble.html
Created May 6, 2014 19:46
test custom element for thimble (ultra portable!)
<script>
(function () {
// super secret special shim for loading Polymer elements in weird situations
if (!window.Polymer) {
var base = location.protocol === 'https:' ? 'https://appmaker-integration.herokuapp.com' : 'http://localhost:1999/';
var waiting = [];
window.Polymer = function(){waiting.push(arguments)};
["/vendor/polymer/polymer.html", "/ceci/ceci-element.html", "/ceci/ceci-definition.html"].forEach(function(src) {
var l = document.createElement('link');
l.rel="import";
@secretrobotron
secretrobotron / gist:651f534a5191dbe360a2
Last active August 29, 2015 14:05
Incremental Zalgo
// Remixed from http://eeemo.net/ and http://stackoverflow.com/questions/6579844/how-does-zalgo-text-work
// data set of leet unicode chars
//---------------------------------------------------
//those go UP
var zalgo_up = [
'\u030d', /* Ì */ '\u030e', /* ÌŽ */ '\u0304', /* Ì„ */ '\u0305', /* Ì… */
'\u033f', /* Ì¿ */ '\u0311', /* Ì‘ */ '\u0306', /* ̆ */ '\u0310', /* Ì */
'\u0352', /* ͒ */ '\u0357', /* ͗ */ '\u0351', /* ͑ */ '\u0307', /* ̇ */
'\u0308', /* ̈ */ '\u030a', /* ̊ */ '\u0342', /* ͂ */ '\u0343', /* ̓ */
@secretrobotron
secretrobotron / gist:52973ecd6bbaeddb33ef
Created July 21, 2015 21:10
filter and prioritize by specific country
SELECT * FROM projects INNER JOIN users ON users.id = projects.user_id WHERE projects.deleted_at IS NULL AND projects.featured = TRUE
ORDER BY
CASE country
WHEN 'CA' THEN 1
ELSE 2
END , projects.created_at DESC LIMIT 50 OFFSET 0;
Coverage: 79.20% (522/2510)
services/api/handlers/elements.js missing coverage on line(s): 4, 13, 14, 17, 27, 32, 33, 36, 39, 46, 52, 53, 56, 57, 60, 71, 72, 74, 75, 78, 79, 82, 89, 90, 93, 94, 95, 98, 105, 112, 122, 127, 128, 131, 138, 145, 153
services/api/handlers/pages.js missing coverage on line(s): 5, 14, 15, 16, 18, 21, 28, 35, 46, 51, 52, 55, 63, 69, 70, 73, 74, 77, 88, 89, 90, 92, 93, 96, 97, 100, 101, 104, 112, 113, 114, 116, 119, 120, 121, 122, 125, 132, 139, 149, 154, 155, 158, 165, 172, 179, 187
services/api/handlers/projects.js missing coverage on line(s): 5, 14, 15, 18, 25, 34, 38, 39, 42, 53, 59, 60, 63, 64, 67, 75, 81, 82, 85, 88, 95, 102, 103, 106, 109, 116, 123, 124, 127, 130, 137, 143, 144, 147, 150, 157, 164, 165, 168, 171, 181, 187, 188, 191, 198, 205, 213, 219, 220, 223, 229, 239, 244, 245, 248, 255, 262, 270
services/api/handlers/users.js missing coverage on line(s): 4, 7, 8, 11, 13, 14, 17, 18, 21, 30, 31, 39, 40, 41, 43, 44, 46, 49, 58, 61, 62, 65, 66, 69, 71, 72, 75, 76, 79, 80, 83,
void CXMLConfigurator::ParseXML(TiXmlElement const* root_element, std::string const* root_prefix) {
if (root_element) {
const TiXmlElement* child_element = root_element->FirstChildElement();
while(child_element) {
std::string prefix;
prefix = *root_prefix + ".";
const char* tag = child_element->Value();
const char* text = child_element->GetText();
if (tag) {
std::string key(prefix + tag);
CBaseDatorPtr* CConfigurator::Get(std::string const& key) {
CBaseDatorPtr* ptr = NULL;
std::map<std::string, CBaseDatorPtr>::iterator i = configuration_.find(key);
//just use the first one for now (if it exists at all)
if (i != configuration_.end()) ptr = &(i->second);
return ptr;
}
@secretrobotron
secretrobotron / closuresarefun.js
Created June 25, 2011 15:34
closures are fun
var Beep = function() {
var foofoo;
this.fun = function () {
foofoo=3;
};
};
(function(){
var foo;
Beep.prototype.bar = function () {
var paladin = new Paladin({
setup: function (paladin) {
paladin.tasker.add({...});
},
run: function (paladin) {
paladin.graphics.blah({...});
}
});
@secretrobotron
secretrobotron / gist:1250778
Created September 29, 2011 14:01
CubicVR Wireframe Syntax
var boxMesh = new CubicVR.Mesh({
primitives:{
type: "box",
size: 1.0,
material: material3,
uvmapper: uvcubic
},
wireframe: {
enabled: true,
triangulate: true,
@secretrobotron
secretrobotron / gist:2630165
Created May 7, 2012 20:23
TrackEvent documentation

Module: TrackEvent

Supports a single event in the Media > Track > TrackEvent model.

Class: TrackEvent

Represents and governs a single popcorn event.

  • param options : Options for initialization. Can contain the properties type, name, and popcornOptions. If the popcornOptions property is specified, its contents will be used to initialize the plugin instance associated with this TrackEvent.

Usage: TrackEvent(options)