Skip to content

Instantly share code, notes, and snippets.

View markiv's full-sized avatar

Vikram Kriplaney markiv

View GitHub Profile
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 22, 2024 11:03
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@staltz
staltz / introrx.md
Last active June 21, 2024 12:27
The introduction to Reactive Programming you've been missing
@genadyo
genadyo / gist:295a5e8f0d743f57137f
Created November 27, 2014 17:21
app_store_app_data.json
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
@hollance
hollance / Barfdown.markdown
Last active March 25, 2023 18:16
A markdown-ish parser written in Swift 2.0

Barfdown: a Markdown-ish Parser Written in Swift

Goals for this project:

  • Parse a simplified version of Markdown that is good enough for writing my blog posts.
  • Be reasonably efficient. This means the parser shouldn't copy substrings around if not necessary. This is done by storing all the elements as indexes into the original text.
  • Be small and therefore be easy to understand.
  • No regular expressions. They are the lazy person's solution to parsing. ;-)

This is just a toy project for me to experiment with writing parsers in Swift. Because why not?

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@pdanford
pdanford / README.md
Last active June 15, 2024 00:02
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@zlbruce
zlbruce / svg2icns
Created October 1, 2016 01:17
covert svg to icns (with imagemagick)
#!/bin/bash
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
fi
filename="$1"
name=${filename%.*}
ext=${filename##*.}
echo "processing: $name"
@wojteklu
wojteklu / clean_code.md
Last active June 23, 2024 09:27
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

import Foundation
extension URLComponents {
/// Abstracts away URLComponent’s array of URLQueryItems into a simple dictionary
var parameters: [String: CustomStringConvertible] {
get {
return queryItems?.reduce(into: [String: String]()) { $0[$1.name] = $1.value } ?? [:]
}
set {
queryItems = newValue.map { URLQueryItem(name: $0.key, value: String(describing: $0.value)) }
@kenthumphries
kenthumphries / embed-debug-only-framework.sh
Last active October 20, 2023 14:10
Script to be called as part of an Xcode Run Script build phase. This will ensure that script Input File is copied (and code signed) to script Output File.
#!/bin/sh
# This script embeds (and codesigns) a framework within an iOS app binary, but only when the configuration is Debug.
# It must be called from, or copied into an Xcode Run Script build phase with following setup:
# Input Files:
# - Path to framework within project folder (source path)
# - For example: $(SRCROOT)/ThirdPartyFrameworks/SimulatorStatusMagiciOS.framework
# Output Files:
# - Desired path to framework within ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH} (destination path)
# - For example: ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/SimulatorStatusMagiciOS.framework