Skip to content

Instantly share code, notes, and snippets.

@alanzeino
alanzeino / new-mac.md
Last active March 11, 2025 17:04
New Mac Setup

All the stuff I do to set up a new Mac

Applications

  • 1Password (hijacks the Snippety window)
  • AirBuddy
  • Amphetamine
  • BlockBlock
  • Cork (much better than Brewer X)
  • CotEditor (fastest text editor with multi–line editing)
  • DaisyDisk
  • Fantastical
@ollieatkinson
ollieatkinson / HTTPStatusCode.swift
Last active April 12, 2025 22:44
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational
@joyrexus
joyrexus / README.md
Created March 13, 2015 20:59
CS basics

At the risk of stating the obvious, any CS major needs a solid understanding of combinatorics, probability, and complexity. Consider studying Concrete Mathematics to bone up on core techniques.

Basic topics you should regularly review (at least before interviewing for a competitive software engineering position):

  • sorting
  • hashing
  • trees
  • graphs
  • concurrency
@jrodriguez-ifuelinteractive
jrodriguez-ifuelinteractive / gist:baf4fcd033d1adcdc856
Last active February 23, 2017 20:01
Sort Objective-C Array
// NSMutableArray Example
// Using this method will sort your current array
NSMutableArray *unsortedArray = [[NSMutableArray alloc] initWithObjects:@"Albert", @"Eric", @"Betty", nil];
[unsortedArray addObject:@"Carl"];
[unsortedArray addObject:@"David"];
[unsortedArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
NSLog(@"sorted array: %@", unsortedArray);
// NSArray Example
// Using this method will create a new array
@tobru
tobru / README.md
Last active January 7, 2022 10:40
A dashing widget which displays the currently playing song on a squeezebox player.

Logitech Squeezebox Now Playing

Preview

Screenshot: Squeezebox Widget in action

Description

Squeezebox Now Playing is a a Dashing widget which which displays now playing information from a Logitech Squeezebox player.

@mattt
mattt / uiappearance-selector.md
Last active February 7, 2025 15:27
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@zvineyard
zvineyard / json_class.java
Created March 10, 2012 19:56
Java: Get JSON from URL (Android)
public class Json {
public static JSONObject getJson(String url){
InputStream is = null;
String result = "";
JSONObject jsonObject = null;
// HTTP
try {