Skip to content

Instantly share code, notes, and snippets.

View tskulbru's full-sized avatar

Torstein S. Skulbru tskulbru

View GitHub Profile
{
"matrix": [
{
"code": "0x00",
"x": 0,
"y": 0,
"w": 4,
"h": 4,
"layers": {
"0": {

Keybase proof

I hereby claim:

  • I am tskulbru on github.
  • I am tskulbru (https://keybase.io/tskulbru) on keybase.
  • I have a public key ASCCyhpmWAKACNH_zFsvRSSk67QmLzPqASilqH19eZNnwwo

To claim this, I am signing this object:

Verifying that "tskulbru.id" is my Blockstack ID. https://onename.com/tskulbru

Keybase proof

I hereby claim:

  • I am tskulbru on github.
  • I am tskulbru (https://keybase.io/tskulbru) on keybase.
  • I have a public key ASA2AcZHeooAS3zdbjW2361GOm6C4bbaAhYHCSG5DYs1hAo

To claim this, I am signing this object:

@tskulbru
tskulbru / replaceNSlocalized.sh
Created December 22, 2016 13:24
Converts NBLocalization to Swiftgens tr(.). Based on https://gist.github.com/Lutzifer/3e7d967f73e38b57d4355f23274f303d but changed regex to suit my own need.
#/bin/sh
# Run this inside the project to replace NSLocalizedString calls with swiftgen calls in all .swift files.
# Do not forget to make a backup before.
find . -type f | grep ".swift" > swiftindex.temp
while IFS= read -r filename
do
echo $filename
@tskulbru
tskulbru / EnvConfig.swift
Last active August 30, 2016 13:22 — forked from drunknbass/EnvConfig.swift
Firebase stage + Prod config
import Foundation
@objc(EnvConfig)
class EnvConfig: NSObject {
#if ENVConfigStaging
class var isProduction:Bool {
return false
}
Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = iphonesimulator8.3
=== CLEAN TARGET Pods-UIColor+BFPaperColors OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Clean.Remove clean /var/folders/cm/8fl_j9pn3m78tgztk5j93tgm0000gn/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-UIColor+BFPaperColors.build
builtin-rm -rf /var/folders/cm/8fl_j9pn3m78tgztk5j93tgm0000gn/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-UIColor+BFPaperColors.build
@tskulbru
tskulbru / ColorUtils.java
Created March 11, 2015 11:37
Utility class for average and dominant color in a bitmap for Android
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
var O = {
Foo: function() {
return "Foo for life yo!";
}
};
var M = "Foo";
console.log(O[M]());