Skip to content

Instantly share code, notes, and snippets.

View Albinzr's full-sized avatar
⛩️
Focusing

Albin Albinzr

⛩️
Focusing
View GitHub Profile
@Albinzr
Albinzr / libpng.sh
Created April 6, 2018 16:04 — forked from dulacp/libpng.sh
Download & Compile Libpng for iOS (all architectures)
# Builds a Libpng framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libpng in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libpng you want to build, shove it in the
# same directory as this script, and run "./libpng.sh". Grab a cuppa. And voila.
@Albinzr
Albinzr / libjpeg.sh
Created April 6, 2018 16:04 — forked from dulacp/libjpeg.sh
Download & Compile Libjpeg for iOS (all architectures)
# Builds a Libjpeg framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libjpeg in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libjpeg you want to build, shove it in the
# same directory as this script, and run "./libjpeg.sh". Grab a cuppa. And voila.
@Albinzr
Albinzr / libtiff.sh
Created April 6, 2018 16:04 — forked from dulacp/libtiff.sh
Download & Compile Libtiff for iOS (all architectures)
# Builds a Libtiff framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libtiff in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libtiff you want to build, shove it in the
# same directory as this script, and run "./libtiff.sh". Grab a cuppa. And voila.
<style>
.iframe-container {
background: #ccc;
position: relative;
height: 0;
padding-bottom: 75%; /* 4/3 on mobile, padding = 3/4 */
}
.iframe-container iframe {
position: absolute;
top: 0;
@Albinzr
Albinzr / libz.sh
Created April 6, 2018 16:01 — forked from dulacp/libz.sh
Download & Compile Libz (zlib) for iOS (all architectures)
# Builds a ZLib framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libz in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libz you want to build, shove it in the
# same directory as this script, and run "./libz.sh". Grab a cuppa. And voila.
@Albinzr
Albinzr / universal-framework.sh
Created April 6, 2018 15:56 — forked from atsepkov/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures). This version works with Cocoapods, merging simulator and device architectures for intermediate libraries as well. To use this script, go to Product > Scheme > Edit S…
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@Albinzr
Albinzr / universal-framework.sh
Created April 6, 2018 15:56 — forked from atsepkov/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures). This version works with Cocoapods, merging simulator and device architectures for intermediate libraries as well. To use this script, go to Product > Scheme > Edit S…
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@Albinzr
Albinzr / index.ios.js
Created November 7, 2017 18:58 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@Albinzr
Albinzr / map-filter-reduce.playground
Created February 12, 2017 12:35 — forked from AccordionGuy/map-filter-reduce.playground
Map, filter, and reduce in Swift, explained with emoji
// Map
func cook(_ item: String) -> String {
let cookupTable = [
"🐮": "🍔", // Cow face -> burger
"🐄": "🍔", // Cow -> burger
"🐂": "🍖", // Ox -> meat on bone
"🐷": "🍖", // Pig face -> meat on bone
"🐽": "🍖", // Pig nose -> meat on bone
"🐖": "🍖", // Pig -> meat on bone
@Albinzr
Albinzr / validation.js
Created February 12, 2017 12:28 — forked from pavsidhu/validation.js
Validate.js constraints
export const validation = {
email: {
presence: {
message: '^Please enter an email address'
},
format: {
pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
message: '^Please enter a valid email address'
}
},