Skip to content

Instantly share code, notes, and snippets.

View respectTheCode's full-sized avatar

Kevin Smith respectTheCode

  • Playlister
  • Indianapolis, IN
View GitHub Profile
public class APMapboxLayer extends APLayer {
private MapView mMapView;
public APMapboxLayer(final Context context, final LayerDataSource data, final float density, final float scale, final View.OnClickListener hotspotClickListener) {
super(context, data, density, hotspotClickListener);
String mapId = data.getMapId();
if (mapId == null) {
#import "APMapBoxLayer.h"
@implementation APMapBoxLayer {
MKMapView *_mapView;
MBXRasterTileOverlay *_rasterOverlay;
NSString *_mapId;
BOOL _usingOfflineMap;
BOOL _readyToDownload;
BOOL _didStartDownload;
@respectTheCode
respectTheCode / gist:1292465
Created October 17, 2011 11:57
This angularjs directive adds/removes a class if an expression is true. It requires jQuery and uses the expression syntax "(`expression`) ? `className` [: `className`]".
angular.directive("ng:class", function (expression, compiledElement) {
if (typeof(expression) == "string") {
if (expression.indexOf(",")) {
expression = expression.split(",");
} else {
expression = [expression];
}
}
return function (element) {
@respectTheCode
respectTheCode / gist:3917501
Created October 19, 2012 10:45
Jakefile for building and packaging node-webkit
var fs = require("fs");
var path = require("path");
var async = require("async");
var jade = require("jade");
var stylus = require("stylus");
var paths = {
stylus: {src: "./styles", dest: "./build/styles"},
jade: {src: "./views", dest: "./build"},
javascripts: {src: "./javascripts", dest: "./build/javascripts"},

Keybase proof

I hereby claim:

  • I am respectthecode on github.
  • I am respectthecode (https://keybase.io/respectthecode) on keybase.
  • I have a public key ASBTaqVJ8ZMG_x1C7wJh1779mVrRBExcho6E66VlSYCBCQo

To claim this, I am signing this object:

@respectTheCode
respectTheCode / static_server.js
Created February 27, 2012 20:36 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mime = require("mime")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname