Skip to content

Instantly share code, notes, and snippets.

curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.*._hd_.*dl=1">HD' | sed -e 's/\?dl=1">HD//g' | xargs -n1 wget -N g
@leearmstrong
leearmstrong / gist:2226821
Created March 28, 2012 14:52
Draws a circle with a number in the middle
//// Abstracted Graphic Attributes
NSString* textContent = [NSString stringWithFormat:@"%i",[myAnnotation.annotations count]];
//// General Declarations
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = UIGraphicsGetCurrentContext();
//// Gradient Declarations
NSArray* gradient3Colors = [NSArray arrayWithObjects:
(id)[UIColor lightGrayColor].CGColor,
@leearmstrong
leearmstrong / gist:8674334
Created January 28, 2014 19:22
PPS Source for GPS
/*
* Copyright (C) 2013 the8thlayerof.net
*
* GPS cape for UART4 on connector pins P9.11 P9.13 P8.26
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
-- copied from: http://mogmet.blog20.fc2.com/blog-entry-55.html
select @@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH as GLOBAL_BUFFER_SIZE, @@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFFER_SIZE + @@GLOBAL.READ_BUFFER_SIZE + @@GLOBAL.JOIN_BUFFER_SIZE + @@GLOBAL.READ_RND_BUFFER_SIZE as THREAD_BUFFER_SIZE, @@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH + (@@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFFER_SIZE + @@GLOBAL.READ_BUFFER_SIZE + @@GLOBAL.JOIN_BUFFER_SIZE + @@GLOBAL.READ_RND_BUFFER_SIZE) * @@GLOBAL.MAX_CONNECTIONS AS TOTAL_MEMORY_SIZE, (@@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH + (@@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFF
@leearmstrong
leearmstrong / simulator_populator_xcode7
Created July 1, 2016 06:57 — forked from cabeca/simulator_populator_xcode7
This script removes and recreates all simulators in Xcode 7.
#!/usr/bin/env ruby
require 'JSON'
device_types = JSON.parse `xcrun simctl list -j devicetypes`
runtimes = JSON.parse `xcrun simctl list -j runtimes`
devices = JSON.parse `xcrun simctl list -j devices`
devices['devices'].each do |runtime, runtime_devices|
runtime_devices.each do |device|
@leearmstrong
leearmstrong / syncmap.go
Created January 3, 2017 04:46 — forked from lateefj/syncmap.go
Simple Shared Map Example In Go With Timeouts
// Example on sharing a map with multiple goroutines
package main
import (
"errors"
"fmt"
"sync"
"time"
)
@leearmstrong
leearmstrong / Add Screen Recorder Button.py
Created February 28, 2016 17:37 — forked from BenjyWiener/Add Screen Recorder Button.py
Screen recorder for Pythonista
# coding: utf-8
from objc_util import *
from UIKit import *
from Foundation import *
from ReplayKit import *
from console import alert
def main():
rootVC = UIApplication.sharedApplication().keyWindow().rootViewController()
package main
import (
"bytes"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"sync"
@leearmstrong
leearmstrong / sample.csv
Created December 13, 2019 12:45
Sample flight path data
lat lon pos_update_time altitude heading speed vert_rate
51.477905 -0.356091 13/12/2019 12:43:10 1925 270 113 -384
51.477905 -0.353641 13/12/2019 12:43:07 1925 270 113 -576
51.477951 -0.349781 13/12/2019 12:43:04 2000 270 120 -768
51.477951 -0.347331 13/12/2019 12:43:00 2000 270 121 -896
51.477951 -0.344288 13/12/2019 12:42:57 2050 270 134 -896
51.477951 -0.341987 13/12/2019 12:42:54 2075 270 131 -512
51.477997 -0.338795 13/12/2019 12:42:51 2100 270 135 -896
51.477978 -0.335617 13/12/2019 12:42:48 2150 270 136 -832
51.477978 -0.333023 13/12/2019 12:42:45 2200 270 137 -832
func GenerateESRIASC(data *input) {
f, err := os.Create("/tmp/esri.asc")
if err != nil {
fmt.Println(err)
return
}
defer f.Close()
yBottom := (data.FirstRowStartLine - data.IntervalBetweenColumns*(float32(data.NumberOfRowsInField)-1.0))