Skip to content

Instantly share code, notes, and snippets.

View stoeckley's full-sized avatar

andrew stoeckley

  • Balcony Studio
  • Netherlands
View GitHub Profile
OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org
USAGE: clang -cc1 [options] <inputs>
OPTIONS:
-### Print the commands to run for this compilation
--analyze Run the static analyzer
--migrate Run the migrator
--relocatable-pch Build a relocatable precompiled header
--serialize-diagnostics <value>
@stoeckley
stoeckley / openssl-build.sh
Last active May 22, 2016 12:52 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Text.Parsec
import Text.Parsec.String
import Text.Parsec.Char
import Control.Monad
import Data.List
import Data.Either
#!/bin/bash
# Ease staging of files
for i in $(git status | grep -A 10000 "not updated" | grep modified) ; do
if [ -f $i ] ; then
git diff $i;
echo -n "Add this to stage? [y/n]: ";
read ans;
if [ "$ans" == "y" ] ; then
@stoeckley
stoeckley / Animation.md
Created May 31, 2017 06:26 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

  • view hierarchy
  • layer tree
@stoeckley
stoeckley / makeAnimatedGif.m
Created June 3, 2017 13:45 — forked from mayoff/makeAnimatedGif.m
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
@stoeckley
stoeckley / Main.elm
Created July 9, 2017 19:03 — forked from anonymous/Main.elm
Untitled
port module Main exposing (..)
import Html exposing (Html, text, program)
import Html.Events exposing (on)
import Html.Attributes exposing (type_, src)
import Json.Decode as Decode exposing (Value, Decoder)
port readImage : Value -> Cmd msg
@stoeckley
stoeckley / destructuring.md
Created July 10, 2017 15:16 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@stoeckley
stoeckley / elm-questions.md
Last active July 13, 2017 23:38
Questions about The Elm Architecture

Philosophies that good functional programmers from the Elm and Clojurescript communities should agree on:

  1. An application should have a single source of truth -- all your model data in one place.
  2. Your model data structure should not depend on your interface; a data model should be organized in whatever way is good for the sake of the data, only. View structure != model structure.
  3. View functions should receive only the data they need for building themselves. Whole model state should not be passed freely everywhere, as this gives most views much more information than they need; this would also make it difficult to build re-usable components, if view functions must also query deeply into a custom data store in addition to performing view logic. Beyond this, it creates a conceptual burden on developers when all views are handling whole model state, you cannot easily follow the flow of data access.
  4. Related to 3), a view should not inject a data dependency into its parent. That is, all the view nodes/fu
@stoeckley
stoeckley / clojure-emacs.el
Created July 20, 2017 19:54
clojure setup in emacs
;; Clojure IDE and REPL for Emacs
(require-package 'cider)
;; autocompletion
(require-package 'company)
;; REPL related stuff
;; REPL history file
(setq cider-repl-history-file "~/.emacs.d/cider-history")