// jQuery
$(document).ready(function() {
// code
})
This file contains hidden or 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
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) |
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
// ========================================================================================== | |
// 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"); |
This file contains hidden or 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
// 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 |
This file contains hidden or 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
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> |
This file contains hidden or 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
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', |
This file contains hidden or 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
import re | |
import json | |
ws_re = re.compile("\s+") | |
line_num_re = re.compile("\s\d+\s{2,}", re.M) | |
# first, pdftotext -layout <pdf> <text> | |
with open("12-307_jnt1.txt", "r") as f: | |
data = f.read() |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
This file contains hidden or 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
import pytz | |
import datetime | |
import time | |
import urllib2 | |
import json | |
import os | |
import elementtree.ElementTree as ET | |
# e.g. http://scores.nbcsports.msnbc.com/ticker/data/gamesMSNBC.js.asp?jsonp=true&sport=MLB&period=20120929 | |
url = 'http://scores.nbcsports.msnbc.com/ticker/data/gamesMSNBC.js.asp?jsonp=true&sport=%s&period=%d' |