Skip to content

Instantly share code, notes, and snippets.

View Albinzr's full-sized avatar
⛩️
Focusing

Albin Albinzr

⛩️
Focusing
View GitHub Profile
@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.
@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 / 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 / libzthread.sh
Created April 6, 2018 16:04 — forked from dulacp/libzthread.sh
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.
@Albinzr
Albinzr / libexiv2.sh
Created April 6, 2018 16:04 — forked from dulacp/libexiv2.sh
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.
@Albinzr
Albinzr / smallestPositiveMissingIntigerInArray.swift
Created May 17, 2018 12:40
Find smallest +ve missing from array in swift
import Foundation
var a = [1, 3, 6, 4, 1, 2]
var b = [1,2,3]
var c = [-1,-2,-3]
func findNearestMissingSmallValue(numberArray:[Int]) -> Int{
var b = numberArray.sorted()
var smallestValue:Int?
@Albinzr
Albinzr / create-fat-framework.sh
Created December 14, 2018 12:17 — forked from sundeepgupta/create-fat-framework.sh
Script to create a universal or "fat" binary for an iOS framework.
#!/bin/bash
# Adapted from http://stackoverflow.com/questions/24039470/xcode-6-ios-creating-a-cocoa-touch-framework-architectures-issues/26691080#26691080
# and https://gist.github.com/cromandini/1a9c4aeab27ca84f5d79
# Create a new aggregate target.
# For the automatically generated scheme, change its build config to "release".
# Ensure this target's "product name" build setting matches the framework's.
# Add a run script with `source "${PROJECT_DIR}/path_to_this_script`
@Albinzr
Albinzr / .gitlab-ci.yml
Created January 4, 2019 20:38 — forked from troyharvey/.gitlab-ci.yml
Deploy Google Cloud Functions: GitLab CI/CD Pipeline Config File
variables:
GCP_PROJECT_ID: {YOUR GOOGLE CLOUD PROJECT ID}
GCP_ZONE: us-central1-a
services:
- docker:dind
stages:
- npm-install
- push
@Albinzr
Albinzr / .gitlab-ci-npm.yml
Created January 4, 2019 20:39 — forked from charleslouis/.gitlab-ci-npm.yml
deploy-gitlab-2-linode.md , gitlab, deploy, PROJ_OWNER , DEPLOY_DIR, .gitlab-ci.yml
deploy-prod:
variables:
GIT_STRATEGY: none
stage: deploy
only:
- master
script:
- sudo -u $PROJ_OWNER git --git-dir=$DEPLOY_DIR/.git --work-tree=$DEPLOY_DIR fetch origin $CI_COMMIT_REF_NAME
- sudo -u $PROJ_OWNER git --git-dir=$DEPLOY_DIR/.git --work-tree=$DEPLOY_DIR reset --hard FETCH_HEAD
- sudo -H -u $PROJ_OWNER chmod u+x $DEPLOY_DIR/nodescripts.sh
package main
import (
"io"
"log"
"os"
"os/exec"
"io/ioutil"
"bytes"
)