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 getScript (src, callback) { | |
var scripts = document.getElementsByTagName('script'); | |
var script = document.createElement("script"); | |
var once = true; | |
script.async = "async"; | |
script.type = "text/javascript"; | |
script.src = src; | |
script.onload = script.onreadystatechange = function () { | |
if (once && (!script.readyState || /loaded|complete/.test(script.readyState))) { | |
once = false; |
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
/** | |
* This script helps to artifically generate load on a web application through | |
* weighted requests to various endpoints. It may not be pretty, but it works | |
* for me. :) Feel free to use however you want. | |
* | |
* NOTE: Please use responsibly, don't run this script against a production server! | |
* | |
* @author Jordan Kasper (@jakerella) | |
* @license MIT | |
*/ |
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
const {createStore} = require('redux'); | |
const mapValues = require('lodash/object/mapValues'); | |
const get = require('lodash/object/get'); | |
const initialState = (typeof window !== "undefined" && window.PRELOAD) || {}; | |
const reducers = {}; | |
function serializeable(value) { | |
return ( | |
value instanceof Error ? {error: value.stack} |
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 Tasker () { | |
this.tasks = []; | |
this.wait(); | |
} | |
Tasker.prototype = { | |
resolution: 1000, | |
timeoutID: 0, | |
isWaiting: false, | |
tasks: [], | |
add: function (name, perform, interval) { |
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
[2012-06-13 09-35-13-28] Log (Exception,High): System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Exception: Could not connect to port 62078 | |
at iMobileDeviceSharp.Discovery.USB.UsbmuxDevice.<>c__DisplayClass1.<ConnectAsync>b__0(Task connectTask) | |
at System.Threading.Tasks.Task.<>c__DisplayClasse`1.<ContinueWith>b__d() | |
at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj) | |
at System.Threading.Tasks.Tas |
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
/* | |
From @craigpfau - http://craigpfau.com/2012/02/phonegap-ios-uiwebview-and-safari-app-links/ | |
To just enable UIWebView for the single URL I used this code [projectFolder > Classes > MainViewController.m] | |
*/ | |
- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType | |
{ | |
NSURL *url = request.URL; | |
if ([url.absoluteString rangeOfString:@"URLToOpenInUIWebView.com"].location != NSNotFound) { | |
return YES; |
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
<div> | |
<h1>Tweetbox</h1> | |
<form id="my-tweetbox"> | |
<p><textarea name="tweet">Write your tweet...</textarea></p> | |
<p><input type="submit" name="submit" value="Tweet!" /></p> | |
</form> | |
</div> | |
<div> | |
<h1>County Tweetbox</h1> |
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
<a href="javascript:foo()">foo</a> | |
<script> | |
function foo() { | |
function allDone () { | |
return 'sweet, declaration at the beginning.' | |
} | |
'set a break here'; | |
'check out the scope variables'; |
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 getQuery(s) { | |
var query = {}, i = s.indexOf('?'); | |
if (i != -1) { | |
s.substr(i+1).replace(/\+/g, ' ').replace(/([^&;=]+)=?([^&;]*)/g, function (m, k, v) { | |
query[decodeURIComponent(k)] = decodeURIComponent(v); | |
}); | |
} | |
return query; | |
} | |
//_GET = getQuery(location.href); |
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></head> | |
<body> | |
<script> | |
function sendThemAlong(){ | |
var href = location.href; | |
if (!href.match("store_redirect=true")) { | |
var done = false; |