Skip to content

Instantly share code, notes, and snippets.

Jake Rutter jrutter

View GitHub Profile
@christian-bromann
christian-bromann / webdriver.js
Last active Dec 30, 2015
Use Webdriverjs with Sauce Labs (example)
View webdriver.js
var webdriverjs = require('../index'),
client = webdriverjs.remote({
desiredCapabilities: {
browserName: 'chrome',
version: '27',
platform: 'XP',
tags: ['examples'],
name: 'This is an example test'
},
host: 'ondemand.saucelabs.com',
@aaronksaunders
aaronksaunders / app_snippet_1.js
Last active Aug 25, 2017
Utilizing the Queue Library from Async.js for downloading multiple assets with Appcelerator Titanium
View app_snippet_1.js
//
// https://github.com/caolan/async
//
var async = require('async');
// this function will be called for each array element
function process(_url, _processCallback) {
// download the file
get_file(_url, function(_resp) {
@pmeenan
pmeenan / user-timing-rum.js
Last active Jun 16, 2020
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
View user-timing-rum.js
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@chrislkeller
chrislkeller / import_json_appsscript.js
Last active Jul 24, 2020
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
View import_json_appsscript.js
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@afeld
afeld / gist:4952991
Last active Jul 17, 2020
good APIs for mashups
View gist:4952991

This list has been superseded by Public APIs. Check there for APIs with Auth: No, HTTPS and CORS Yes.


List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.

@steinbring
steinbring / StoreFormValuesInLocalStorage-Part1.html
Created Nov 18, 2012
How to use localStorage and sessionStorage to make form values persistant
View StoreFormValuesInLocalStorage-Part1.html
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="windows-1252">
<title>Keep webform data persistent</title>
<!-- jQuery CDN -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
/*Float the form labels to the left and allow them 40% of the width of the form*/
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active Jul 31, 2020
Luhn algorithm in Javascript. Check valid credit card numbers
View validate_credit_card.js
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@tomoyukiinoue
tomoyukiinoue / 00_prepare
Created Oct 14, 2012
Install Rails 3.2.8 for Mac OS X Mountain Lion (10.8.2)
View 00_prepare
1. Install Xcode 4.5.1 from AppStore.
1. Install Command Line Tools via Xcode preferences.
@aaronksaunders
aaronksaunders / app.js
Created May 20, 2012
Appcelerator Titanium Yelp API v2.0 Integration
View app.js
//
// Aaron K. Saunders
//
// http://www.clearlyinnovative.com
// http://blog.clearlyinnovative.com
// @aaronksaunders
//
// SEE http://bytespider.github.com/jsOAuth/ for jsOAuth.js
//
Ti.include("jsOAuth.js");
View states_hash.json
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
You can’t perform that action at this time.