alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
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
# Based on Waveshare's epd5in65f.py demo. Copyright notice at end. | |
import sys | |
import os | |
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') | |
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') | |
if os.path.exists(libdir): | |
sys.path.append(libdir) |
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
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
NSApplication.shared.run { | |
VStack { | |
Text("Hello, World") | |
.padding() | |
.background(Capsule().fill(Color.blue)) |
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
As of iOS 11/macOS High Sierra, and only including ones in Foundation and CoreFoundation | |
Strings: | |
_NSCFString - a CFStringRef or CFMutableStringRef. This is the most common type of string object currently. | |
- May have 8 bit (ASCII) or 16 bit (UTF-16) backing store | |
_NSCFConstantString - a compile time constant CFStringRef, like you'd get with @"foo" | |
- May also be generated by dynamic string creation if matches a string in a pre-baked table of common strings called the StringROM | |
NSBigMutableString - an NSString backed by a CFStorage (https://github.com/opensource-apple/CF/blob/master/CFStorage.h) for faster handling of very large strings | |
NSCheapMutableString - a very limited NSMutableString that allows for zero-copy initialization. Used in NSFileManager for temporarily wrapping stack buffers. |
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
#!python | |
# To use this, you need Python 3 and also the pyobjc module. | |
# pip install pyobjc | |
import objc | |
from Foundation import NSBundle, NSString | |
import datetime | |
import time | |
import sys |
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
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
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
#!/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| |
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
CREATE TYPE pluto_reverse_geocode_result AS (address text, ownername text,distance float); | |
CREATE OR REPLACE FUNCTION pluto_reverse_geocode(float,float,int) RETURNS SETOF pluto_reverse_geocode_result | |
AS ' | |
WITH subq as (SELECT address,the_geom,ownername | |
FROM nyc_mappluto_13v1 | |
ORDER BY the_geom <-> CDB_LatLng($1,$2) LIMIT 20) | |
SELECT address,ownername, | |
ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) as distance | |
FROM subq | |
WHERE ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) < $3 |
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
################################### | |
## CartoDB 2.0 Install [Working] ## | |
## Tested on Ubuntu 12.04 ## | |
################################### | |
# Change password | |
passwd | |
adduser [username] | |
adduser [username] sudo |
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
//Furthest distance travelled from start point. // http://javi.cartodb.com/api/v2/sql?q= | |
WITH points AS | |
(SELECT | |
(SELECT (the_geom) FROM stratos ORDER BY id ASC LIMIT 1) as p1, | |
(SELECT (the_geom) FROM stratos | |
WHERE ST_x(the_geom)<180 AND ST_x(the_geom)>-180 AND ST_x(the_geom)<>0 | |
AND ST_x(the_geom)<>0 ORDER BY ST_Distance(the_geom,(SELECT the_geom | |
FROM stratos ORDER BY id ASC LIMIT 1)) DESC LIMIT 1) as p2 | |
) | |
SELECT ST_distance(p1::geography,p2::geography) as furthest_distance FROM points |
NewerOlder