Skip to content

Instantly share code, notes, and snippets.

View OdNairy's full-sized avatar

Roman Gardukevich OdNairy

View GitHub Profile
@OdNairy
OdNairy / objc-accessors.mm
Created December 10, 2014 11:24
The real difference between atomic/nonatomic
if (!atomic) {
oldValue = *slot;
*slot = newValue;
} else {
spin_lock_t *slotlock = &PropertyLocks[GOODHASH(slot)];
_spin_lock(slotlock);
oldValue = *slot;
*slot = newValue;
_spin_unlock(slotlock);
}
@marcprux
marcprux / ProfileSharedKeySetTests.m
Created July 16, 2012 15:13
Simple test case to profile any speed increases that might come out of using the new dictionaryWithSharedKeySet method of creating dictionaries
//
// ProfileSharedKeySetTests.m
// ProfileSharedKeySetTests
//
// Created by Marc Prud'hommeaux <mwp1@cornell.edu> on 7/16/12.
//
/**
Simple test case to profile any speed increases that might come out of using the new dictionaryWithSharedKeySet method of creating dictionaries.
@ichitaso
ichitaso / install_theos.sh
Last active August 6, 2016 00:15 — forked from r-plus/install_theos.sh
Theos install script
#!/bin/bash
export THEOS=/opt/theos
if ! [ -d $THEOS ]; then
mkdir -p $THEOS
fi
# clone theos.git
cd /opt
git clone git://github.com/DHowett/theos.git
@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;
@mattt
mattt / regex.swift
Created August 11, 2014 18:08
Creating a regular expression object from a String literal
class Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: nil, error: nil)
}
required init(pattern: String, options: NSRegularExpressionOptions = nil) {
self.pattern = pattern
@steventroughtonsmith
steventroughtonsmith / Tweak.xm
Created October 14, 2015 06:33
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
@JohannesRudolph
JohannesRudolph / TestflihtappDeployTeamcity.sh
Created January 26, 2012 22:04
Builds and deploys an App to testflightapp.com. Integrates with Teamcity.
#!/bin/bash
#
# testflightapp.com tokens
API_TOKEN="YOUR_API_TOKEN"
TEAM_TOKEN="YOUR_TEAM_TOKEN"
PRODUCT_NAME="RowMotion"
ARTEFACTS="$PWD/Artefacts"
@tlewin
tlewin / chat.rb
Last active March 28, 2018 22:57
#!/usr/bin/env ruby -I ../lib -I lib
# coding: utf-8
require 'rtoken'
require 'json'
require 'sinatra/base'
require 'thin'
class Chat < Sinatra::Base
@alloy
alloy / gist:10481169a3acfeeeba3f7c23c5b1b400
Created September 26, 2016 12:09
Run on iOS 10 device from Xcode 7.
cp -R /Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A345\) \
/Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

Using Swift Package Manager with iOS

Step 1:

File > New > Project...

Step 2:

Create a Package.swift file in your root project directory, add dependencies, then run swift package fetch on the command line in the same directory. We’re not going to run swift build because it will just complain.