Skip to content

Instantly share code, notes, and snippets.

timezones.locations = [
{ name: "San Francisco", lat: 37.775, long: -122.4183333, timezone: "America/Los_Angeles" },
{ name: "Memphis", lat: 35.6331, long: -88.8208, timezone: "America/Chicago" },
{ name: "New York", lat: 40.7141667, long: -74.0063889, timezone: "America/New_York" },
{ name: "Tucumán", lat: -26.8166667, long: -65.2166667, timezone: "America/Argentina/Tucuman" },
{ name: "London", lat: 51.5, long: -0.116667, timezone: "Europe/London" },
{ name: "Paris", lat: 48.866667, long: 2.333333, timezone: "Europe/Paris" }
];
@13twelve
13twelve / lightbox.js
Created March 12, 2015 14:47
CR Lightbox
charlierose.Helpers.lightbox = function() {
if ($("#charlierose_lb").length != 0) {
return false;
}
var lightbox_html = '<div id="mask"></div><div id="lightbox" style="display:none;"><iframe src="{{url}}" sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-popups"></iframe></div>';
var active_class = "lightbox-active";
var lightbox_active = false;
@13twelve
13twelve / application.js
Created March 12, 2015 18:44
Keeping track of current media query
charlierose.onReady = function(){
// sort out which media query we're using
charlierose.media_query_in_use = charlierose.Helpers.get_media_query_in_use();
// init behaviors
charlierose.LoadBehavior();
// on resize, check
var resize_timer;
window.on('resize', function(event){
clearTimeout(resize_timer);
resize_timer = setTimeout(function(){
@13twelve
13twelve / ajax_request.js
Created March 17, 2015 10:48
Ajax helper
charlierose.Helpers.ajax_request = function(options) {
/*
where options is an object:
charlierose.Helpers.ajax_request({
url: '/',
type: "POST",
data: { param1: "param1value", param2: "param2value" },
requestHeader: { header: "Content-Type", value: "application/x-www-form-urlencoded; charset=UTF-8" },
onSuccess: function(data){
A17.Helpers.ajax_request = function(settings) {
/*
# A17.Helpers.ajax_request
* v.1
## description
Performs ajax requests
## requires
@13twelve
13twelve / followers.js
Last active October 27, 2020 15:45
Instagram followers js
/*
1:
Install node: http://nodejs.org/download/
2:
Get an access token from Instagram for the user: https://instagram.com/developer/authentication/
3:
Open terminal, cd into the directory where followers.js is.
eg:
@13twelve
13twelve / app.html
Created July 10, 2015 08:59
5px Baseline grid
<!-- 5px baseline grid conditionally added to application layout in development and not production, put at end of of page next to </body> -->
<style>
.baseline_grid_toggle {
position: fixed;
left: 0;
bottom: 0;
background: #600;
color: #fff;
font-size: 11px;
padding: 1px 8px;
@13twelve
13twelve / grids.scss
Created January 19, 2016 18:02
grids
.baseline_grid_toggle,
.vertical_grid_toggle {
position: fixed;
z-index: 9999;
left: 0;
bottom: 0;
background: $color__gold;
color: $color__white;
font-size: 11px;
A17.Helpers.font_observers = function() {
/*
# A17.Helpers.font_observers
* v.1
## description
Adds a class to the document when fonts have loaded
@13twelve
13twelve / head.js
Created January 22, 2016 15:44
head.js
/* to be included compressed, inline, in the head of the document */
var A17 = window.A17 || {};
A17.svgSupport = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1");
A17.browserSpec = (typeof document.querySelectorAll && 'addEventListener' in window && A17.svgSupport) ? "html5" : "html4";
A17.touch = (('ontouchstart' in window) || window.documentTouch && document instanceof DocumentTouch) ? true : false;