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
//EnhanceJS isIE test idea | |
//detect IE and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
//version arg is for IE version (optional) | |
//comparison arg supports 'lte', 'gte', etc (optional) | |
var isIE = (function(){ | |
var doc = document, |
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
function parseQueryString(qs) { | |
qs = qs.replace(/\+/g, ' '); | |
var params = {}, tokens, | |
re = /[?&]:?([^=]+)=([^&#]*)/g; | |
while (tokens = re.exec(qs)) { | |
// console.log(tokens); | |
params[decodeURIComponent(tokens[1])] | |
= decodeURIComponent(tokens[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
#!/usr/bin/env python | |
import getpass | |
import os | |
import subprocess | |
import sys | |
############################################################################### | |
# |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<style-scheme version="1.0" name="Monokai"> | |
<style name="Text" foreground="#e6e5e2" background="#272822"/> | |
<style name="Link" foreground="#66d9ef"/> | |
<style name="Selection" foreground="#e6e5e2" background="#49483e"/> | |
<style name="LineNumber" foreground="#a0a19c" background="#272822"/> | |
<style name="SearchResult" foreground="#ffffff" background="#2572b8"/> | |
<style name="SearchScope" foreground="#000000" background="#e2efff"/> | |
<style name="Parentheses" foreground="#ff0000" background="#c3e1ff"/> | |
<style name="CurrentLine" background="#3e3d32"/> |
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
# usage _.levenshteinDistance("PART", "PARTY") or _("PART").levenshteinDistance("PARTY") | |
_.mixin | |
levenshtein : (str1, str2) -> | |
return str2.length if str1.length == 0 | |
distance = [] | |
for i in [0..str1.length] | |
distance[i] = [] | |
distance[i][0] = i |
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
//////////////////////////////////////////////////////////// | |
// Headers | |
//////////////////////////////////////////////////////////// | |
#include "Stroke.hpp" | |
#include <SFML/OpenGL.hpp> | |
const float myRand(float low, float high) | |
{ | |
return static_cast<float>(std::rand()) / RAND_MAX * (high - low) + low; |
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
#include <utility> | |
#include <thread> | |
#include <limits> | |
#include <algorithm> | |
#include <cassert> | |
#include <vector> | |
#include <cstdint> | |
#include <iostream> | |
#include <mutex> | |
#include <future> |
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
#include <iostream> | |
#include <mutex> | |
std::recursive_mutex log_lock; | |
// If you have ever tried using cerr/cout from multiple threads you may have experienced | |
// character interleaving. These functions avoid that. | |
template <typename A> | |
void log(const A &arg) { | |
log_lock.lock(); |
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
function cssLoad(url, callback) { | |
var promise, | |
resolutions = [], | |
rejections = [], | |
resolved = false, | |
rejected = false, | |
count, id; |
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
/** | |
* Lodash / Underscore method for breaking data sets into smaller sets (chunks) | |
* | |
* @arguments | |
* | |
* collection: Array / Object | |
* chuckSize: Number | |
* | |
* @example | |
* |
OlderNewer