Skip to content

Instantly share code, notes, and snippets.

Project # of Top 100 Free Apps (US)
facebook-ios-sdk 67
Bolts-iOS 48
AFNetworking 39
Google-Mobile-Ads-SDK 38
Reachability (Apple) 38
Crashlytics 37
Flurry-iOS-SDK 31
CocoaPods 30
GoogleConversionTracking 29
@quellish
quellish / FBClasses.txt
Created August 15, 2015 01:50
Facebook iOS App Class List
headers:
_ASAsyncTransaction.h
_ASAsyncTransactionGroup.h
_ASDisabledPanUITextView.h
_ASDisplayLayer.h
_ASDisplayLayerDelegate-Protocol.h
_ASDisplayView.h
_ASImageNodeDrawParameters.h
_ASPendingState.h
_ASTextNodeCachedMetrics.h
@zabirauf
zabirauf / expng.ex
Created July 23, 2015 08:32
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
@smileyborg
smileyborg / Xcode7Macros.h
Last active May 26, 2020 12:08
Backwards compatible macros for Objective-C nullability annotations and generics
/**
* The following preprocessor macros can be used to adopt the new nullability annotations and generics
* features available in Xcode 7, while maintaining backwards compatibility with earlier versions of
* Xcode that do not support these features.
*/
#if __has_feature(nullability)
# define __ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
# define __ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
# define __NULLABLE nullable
@b9chris
b9chris / NN.cs
Created May 27, 2015 20:36
Null Property Coalescence for C# 5 and Below
using System;
using System.Collections.Generic;
using System.Linq;
namespace Brass9
{
/// <summary>
/// Shorthand class for coping with common null situations
/// </summary>
public class NN
@jonathanpeppers
jonathanpeppers / Messaging.cs
Created April 9, 2015 15:23
ObjC Messaging
public static class Messaging
{
[DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern IntPtr Intptr_objc_msgSend(IntPtr receiver, IntPtr selector);
[DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern IntPtr IntPtr_objc_msgSend_byte(IntPtr receiver, IntPtr selector, byte arg1);
[DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern IntPtr IntPtr_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);
@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://",
@VincentH-Net
VincentH-Net / FormsBinding.sketchcs.cs
Last active March 21, 2016 18:09
Xamarin Forms Sketch demonstrating data binding (without strings, to nested objects, to unlimited number of fields) and common app/sketch code. Note: remove the .cs from the file name, it is only there to make GitHub format it as C#
using Xamarin.Forms;
// Additional guidance: see http://vincenth.net/blog/archive/2014/11/27/how-to-share-xamarin-forms-data-binding-code-across-xamarin-sketches-and-apps-without-using-strings.aspx
// NOTE: Once support for creating classes is added to Xamarin Sketches,
// there is no need for this Tuple + enum + BindName + regular expression workaround;
// you can then simply create design data classes in the Sketch and bind to that using
// the same syntax in both projects and sketches, e.g.:
// SetBinding(..., (Person boundPerson) => boundPerson.Name)
// BindName helper function for use with binding to design data in Sketches.
@cullen-tsering
cullen-tsering / SpitOutAndroidAppDir
Last active May 6, 2016 14:47
Spit Out Android Directories
foreach (Environment.SpecialFolder s in (Environment.SpecialFolder[])Enum.GetValues(typeof(System.Environment.SpecialFolder)))
{
Android.Util.Log.Info("App", string.Format("Environment.SpecialFolder.{0}::{1}",Enum.GetName(typeof(Environment.SpecialFolder),s),Environment.GetFolderPath(s)));
}
/* output starts */
/*
Environment.SpecialFolder.Desktop::/data/data/{package name}/files/Desktop
Environment.SpecialFolder.Programs::
@Pretz
Pretz / retina_wrap.swift
Last active November 14, 2017 22:13
Render a view at 2x scale factor in an Xcode playground
func retinaWrap(view: UIView, scaleFactor: CGFloat = 2.0) -> UIView {
let scaleTransform = CGAffineTransformMakeScale(scaleFactor, scaleFactor)
let scaledView = UIView(frame: CGRectMake(0, 0, view.bounds.width * scaleFactor, view.bounds.height * scaleFactor))
view.transform = scaleTransform
view.center = CGPoint(x: scaledView.frame.width / 2, y: scaledView.frame.height / 2)
scaledView.addSubview(view)
return scaledView
}