Skip to content

Instantly share code, notes, and snippets.

require.config({
// enforceDefine: true,
// urlArgs: 'bust=' + (new Date()).getTime(),
waitSeconds: 3,
paths: {
'text': '../components/requirejs-text/text',
'classes': '../scripts/classes',
'jquery': '../components/jquery/jquery',
'jquery.mobile': '../components/jquery-mobile/jquery.mobile',
'jquery.mobileConfig': '../scripts/jquery.mobileConfig',
@Mao8a
Mao8a / fix-to-iOS-iframe-height-issue.html
Created July 10, 2013 05:21
HTML: Fix to iOS iframe height issue
Fix to iOS iframe height issue
<iframe id="stupid-iframe" height="200" src="a-file.html"></iframe>
<html>
<body>
<div class="iframe-wrapper" style="width: 100%; height: 200px; overflow: auto; -webkit-overflow-scrolling: touch;">
</div>
</body>
@chrislkeller
chrislkeller / crowdsourced-map-functions
Created August 5, 2013 20:07
A series of Google Apps Scripts I use to automate some aspects of making crowdsourced maps...
// Add the ID of the spreadsheet here
var spreadsheetID = '0An8W....';
// Add the name of the sheet here
var workingSheetID = 'working_spreadsheet';
// Add the table ID of the fusion table here
var tableIDFusion = '0An8W....';
// key needed for fusion tables api
@sjenkinsdc
sjenkinsdc / scripttest.php5
Created October 21, 2013 16:03
SAXOTECH/NEWSCYCLE Sample template to demonstrate passing variables to a $S script
// ==========================================================================================
// File: /scripts/scripttest/scripttest.php5
// Desc: for testing vars
// Author: Stacey Jenkins
// Date: 10/14/2013
//
// ==========================================================================================
$title = $SOSE->GetVar("Title");
$substrlen1 = $SOSE->GetVar("substrlen1");
$substrlen2 = $SOSE->GetVar("substrlen2");
@joyrexus
joyrexus / README.md
Last active March 22, 2025 12:57 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@chrislkeller
chrislkeller / backup-requirements.sh
Last active April 12, 2021 10:09
A couple quick bash scripts so I can keep virtualenvs somewhat consistent across machines. backup-requirements.sh exports requirements files for each virtualenv, names the files for the virtualenv and sends them to a date-versioned directory. install-requirements.sh loops through a directory of requirements files and checks to see if a virtualen…
#!/bin/bash
# grab the virtualenvwrapper settings
export WORKON_HOME=$HOME/.virtualenvs
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
# the location of your virtualenv wrapper shell script may differ
source /usr/local/share/python/virtualenvwrapper.sh
@lmullen
lmullen / shapefile.r
Last active January 26, 2022 22:07
How I use shapefiles in R with ggplot2 and RGDAL
library(rgdal) # R wrapper around GDAL/OGR
library(ggplot2) # for general plotting
library(ggmaps) # for fortifying shapefiles
# First read in the shapefile, using the path to the shapefile and the shapefile name minus the
# extension as arguments
shapefile <- readOGR("path/to/shapefile/", "name_of_shapefile")
# Next the shapefile has to be converted to a dataframe for use in ggplot2
shapefile_df <- fortify(shapefile)
@sjenkinsdc
sjenkinsdc / phpexamples.php5
Created January 14, 2014 15:01
PHP Examples for the Saxotech Online object (Now Newscycle Digital). The official documentation is lacking php examples, so we put together a script showing each SOSE Property, Method and ENV variables in PHP format. See script results at http://www.tamberra.com/section/phpexamples
// ==========================================================================================
// File: /samples/phpexamples.php5
// Desc: To give users PHP examples of using the SOSE object
// https://docs.newscyclesolutions.com/display/Onl/The+SAXOTECH+Online+object
// Author: Stacey Jenkins
// Date: 1/13/2013
//
// ==========================================================================================
@thomaswilburn
thomaswilburn / Code.gs
Created August 29, 2014 19:20
Apps Script example for handling custom forms
var sheetID = "xxx-id-goes-here-xxx";
var rowConfig = "timestamp name location favorite note lifespan season contact lat lng zone approve feature".split(" ");
/***
Requests may come in with the following parameters:
name
favorite - player name (number?)
note
@knowtheory
knowtheory / google_docs_scraper.js
Created January 13, 2015 14:53
Google Drive has an in document javascript API which allows you to do powerful and crazy things like build a web scraper that runs on a timer. When in a google spreadsheet, go to the tools menu and select "script editor".
// Fetch and append the current temperature
function fetchAndAppendWeather() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getActiveSheet();
// All the actual work is done in the top row.
// We get the link stored in cell A1 (say http://www.wunderground.com/cgi-bin/findweather/getForecast?query=02217 )
var weatherLink = sheet.getRange("A1").getValue();
// we set a formula importing a targeted portion of the web page