Skip to content

Instantly share code, notes, and snippets.

View Albinzr's full-sized avatar
⛩️
Focusing

Albin Albinzr

⛩️
Focusing
View GitHub Profile
package main
import (
"fmt"
lz "github.com/Albinzr/lzGo"
"github.com/pkg/errors"
"log"
"net/http"
_ "net/http/pprof"
)
@Albinzr
Albinzr / Swift3DataTaskDelegate.swift
Created October 15, 2019 18:43 — forked from stinger/Swift3DataTaskDelegate.swift
Swift 3: URLSessionDelegate
//: # Swift 3: URLSessionDelegate
//: The following example shows how to use `OperationQueue` to queue the network requests. This is useful in many ways (for delaying queued requests when the networking goes down for example)
import Foundation
import PlaygroundSupport
class Requester:NSObject {
let opQueue = OperationQueue()
var response:URLResponse?
package main
import (
"io"
"log"
"os"
"os/exec"
"io/ioutil"
"bytes"
)
@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
@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 / 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 / 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 / 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 / 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.