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
// What?! http://stackoverflow.com/a/5571069/700536 | |
function multiline(f) { | |
return f.toString(). | |
replace(/^[^\/]+\/\*!?/, ''). | |
replace(/\*\/[^\/]+$/, ''); | |
} | |
var overrides = multiline(function() {/*! | |
*/}); |
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
- (void)showActivityController | |
{ | |
NSArray *excludedApps = @[ | |
UIActivityTypeAirDrop, | |
UIActivityTypeCopyToPasteboard, | |
UIActivityTypeAddToReadingList, | |
UIActivityTypePrint, | |
UIActivityTypeSaveToCameraRoll | |
]; | |
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 preload(srcs, callback) { | |
var loaded = 0; | |
function loadOrError = function() { | |
loaded++; | |
if (loaded == srcs.length) { | |
if (callback) { | |
callback(); | |
} | |
} |
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 makeItABlackTable() { | |
var $img = $('img'); | |
var $a = $('<div style="background-color:#181817:width:100%;height:100%;display:table"></div>'); | |
var $b = $('<div style="width:100%;height:100%;display:table-cell;vertical-align:middle"></div>'); | |
$a.append($b); | |
$b.append($img); | |
var $body = $('body'); | |
$('body').css('background-color', '#000').append($a); | |
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
// Courtesy of Jeffery Rafter | |
function addToNine(num) { | |
var totals = []; | |
for (var i = 0; i < Math.pow(10, num); i++) { | |
var total = 0; | |
for (var j = 1; j <= num; j++) { |
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
var d = new Date(); | |
d.setMonth(6); | |
d.setDate(11); | |
d.setYear(2014); | |
d.setHours(23); | |
d.setMinutes(59); | |
d.setSeconds(59); | |
function pad(num) { | |
return num < 10 ? "0" + num : num; |
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 class="row"> | |
<div class="w960"> | |
<div class="col-4" style="display:table"> | |
<div class="copy" style="display:table-cell;height:100%;vertical-align:middle;> | |
</div> | |
</div> | |
<div class="slideshow"> | |
</div> | |
</div> | |
</div> |
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
static double toRadians(double degrees) { return degrees / 180.0 * M_PI; }; | |
static double toDegrees(double radians) { return radians * 180.0 / M_PI; }; | |
@implementation NOTagDirectionManager | |
+ (double)directionInDegreesBetweenLocation:(CLLocationCoordinate2D)locationOne | |
andLocation:(CLLocationCoordinate2D)locationTwo | |
{ | |
double lat1 = toRadians(locationOne.latitude); |
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
// | |
// RCViewController.m | |
// recording | |
// | |
// Created by Mike Kavouras on 7/14/14. | |
// Copyright (c) 2014 Mike Kavouras. All rights reserved. | |
// | |
#import "RCViewController.h" | |
#import <AVFoundation/AVFoundation.h> |
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 Weather() { | |
this.weatherData = null; | |
} | |
Weather.prototype = { | |
fetchLatestWeather: function() { | |
var self = this; | |
$.ajax({ |
OlderNewer