Skip to content

Instantly share code, notes, and snippets.

View mikekavouras's full-sized avatar

Mike Kavouras mikekavouras

View GitHub Profile
@mikekavouras
mikekavouras / slack.js
Last active December 21, 2015 00:59 — forked from jeffrafter/slack.js
// What?! http://stackoverflow.com/a/5571069/700536
function multiline(f) {
return f.toString().
replace(/^[^\/]+\/\*!?/, '').
replace(/\*\/[^\/]+$/, '');
}
var overrides = multiline(function() {/*!
*/});
- (void)showActivityController
{
NSArray *excludedApps = @[
UIActivityTypeAirDrop,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAddToReadingList,
UIActivityTypePrint,
UIActivityTypeSaveToCameraRoll
];
function preload(srcs, callback) {
var loaded = 0;
function loadOrError = function() {
loaded++;
if (loaded == srcs.length) {
if (callback) {
callback();
}
}
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);
// 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++) {
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;
<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>
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);
//
// 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>
function Weather() {
this.weatherData = null;
}
Weather.prototype = {
fetchLatestWeather: function() {
var self = this;
$.ajax({