Skip to content

Instantly share code, notes, and snippets.

@dulacp
dulacp / gist:cb6ba6d0ceeeac7539e7
Created June 5, 2015 14:37
Smooth parallax scrolling
var geometry = {};
geometry.scrollTop = function(win, doc) {
if (win.pageYOffset !== undefined) {
return win.pageYOffset;
} else {
return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
}
};
@dulacp
dulacp / aws_s3_user_policy.sh
Created March 22, 2015 19:17
AWS S3 Policy to give access to one user to one bucket
USERNAME="your-username"
BUCKETNAME="my-awesome-bucket-name"
aws iam put-user-policy --user-name $USERNAME --policy-name AmazonS3FullAccess-$USERNAME --policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
@dulacp
dulacp / libexiv2.sh
Created March 3, 2015 02:52
Download & Compile Exiv2 for iOS (all architectures)
# Builds a Exiv2 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 libexiv2 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 libexiv2 you want to build, shove it in the
# same directory as this script, and run "./libexiv2.sh". Grab a cuppa. And voila.
@dulacp
dulacp / libzthread.sh
Created March 3, 2015 00:46
Download & Compile ZThread for iOS (all architectures)
# Builds a ZThread 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 libzthread 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 libzthread you want to build, shove it in the
# same directory as this script, and run "./libzthread.sh". Grab a cuppa. And voila.
@dulacp
dulacp / libz.sh
Created February 28, 2015 01:25
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.
@dulacp
dulacp / libtiff.sh
Created February 28, 2015 01:14
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.
@dulacp
dulacp / libjpeg.sh
Created February 28, 2015 00:57
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.
@dulacp
dulacp / libpng.sh
Last active December 7, 2019 07:54
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.
@dulacp
dulacp / Overlay_iOS_app_version_on_icon_README.md
Last active November 19, 2017 11:18
Overlay the iOS application version on top of the icon

Usage

Requirements

Install the two dependencies, ImageMagick and Ghostscript.

$ brew install imagemagick
$ brew install ghostscript
@dulacp
dulacp / .gitignore
Last active August 29, 2015 14:02
.gitignore for XCode 4/5 with CocoaPods
#########################
# .gitignore file for Xcode5
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# https://gist.github.com/dulaccc/31df7f166a462bf7eacd
#########################