Skip to content

Instantly share code, notes, and snippets.

@tkersey
tkersey / XcodeBuildSettingsReference.md
Created February 3, 2018 23:09 — forked from NSExceptional/XcodeBuildSettingsReference.md
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

@brennanMKE
brennanMKE / directoryExistsAtPath.swift
Created April 20, 2017 22:23
Directory Exists at Path in Swift
fileprivate func directoryExistsAtPath(_ path: String) -> Bool {
var isDirectory = ObjCBool(true)
let exists = FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory)
return exists && isDirectory.boolValue
}
@geeknam
geeknam / cognitoupload.py
Created April 2, 2017 07:13
Upload file to S3 with an authenticated Cognito User
import boto3
import uuid
class CognitoUserFileUploader(object):
def __init__(self, *args, **kwargs):
self.__dict__.update(kwargs)
self.id_token = self.get_cognito_id_token(
self.username, self.refresh_token,
self.device_key, self.client_id
@rootulp
rootulp / export_foursquare_checkins.py
Last active June 13, 2020 01:38 — forked from dlo/export_foursquare_checkins.py
Download all your Foursquare checkins with Python.
# Before running this script execut the following command:
# $ pip install requests
# To run this script execute:
# $ python export_foursquare_checkins.py
import requests
import json
url_template = 'https://api.foursquare.com/v2/users/self/checkins?limit=250&oauth_token={}&v=20131026&offset={}'
# If you navigate to https://developer.foursquare.com/docs/explore, Foursquare
@DonnchaC
DonnchaC / huaiwei-unlock.py
Created September 24, 2016 19:27
Huaiwei unlock code generator - Based on the disassembler generated C code in https://github.com/forth32/huaweicalc
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hashlib
import argparse
import binascii
import struct
def encrypt_v1(imei, key):
@lsurvila
lsurvila / DownloadFileWithRetrofit2RxJava.java
Last active December 22, 2021 15:36
Download file with Retrofit 2, OkHttp, Okio and RxJava
import com.squareup.okhttp.ResponseBody;
import okio.BufferedSink;
import okio.Okio;
import retrofit.Response;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;
interface ApiService {
@orta
orta / _SQL.sql
Last active November 8, 2016 12:12
Top 300 Pods by Application Integrations
SELECT pods.name, stats_metrics.download_total, stats_metrics.download_week, stats_metrics.app_total, stats_metrics.app_week FROM stats_metrics JOIN pods ON stats_metrics.pod_id = pods.id ORDER BY app_total DESC LIMIT 300;
@armcknight
armcknight / install_xcode.sh
Last active February 26, 2021 22:35
Install Xcode via command line
#!/bin/sh
#
# install_xcode.sh
#
# Created by Andrew McKnight on 9/24/15
#
# takes a downloaded .dmg containing Xcode and installs it to a specified location/name, or defaults to /Applications and the DMG's filename
#
@praeclarum
praeclarum / ArrayDiff.swift
Last active January 8, 2021 06:10
A generic diffing operation that can calculate the minimal steps needed to convert one array to another. It can be used to generate standard diffs, or it can be used more creatively to calculate minimal UI updates.
//
// ArrayDiff.swift
//
// Created by Frank A. Krueger on 6/30/15.
// Copyright © 2015 Krueger Systems, Inc. All rights reserved.
// License: MIT http://opensource.org/licenses/MIT
//
import Foundation