Skip to content

Instantly share code, notes, and snippets.

View weibel's full-sized avatar

Kasper Weibel Nielsen-Refs weibel

View GitHub Profile

Keybase proof

I hereby claim:

  • I am weibel on github.
  • I am kasperweibel (https://keybase.io/kasperweibel) on keybase.
  • I have a public key ASDJwNZSly1G-onUpAu8R08wdSK9ZqQuKVBQqkACZJqDZwo

To claim this, I am signing this object:

@weibel
weibel / gist:bb93a54fdc00d0046fbdcab37f1fb172
Last active July 13, 2017 10:56
[NSLocale ISOCountryCodes]
"AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE",
"BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF",
"CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CP", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DG", "DJ", "DK", "DM",
"DO", "DZ", "EA", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF",
"GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC",
"ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP",
"KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG",
"MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF",
"NG", "NI", "NL"
@weibel
weibel / queues.md
Last active November 20, 2021 21:25
iOS persistent queue implementations

Persistent queues are really useful. I have envied Android developers for having the Tape queue http://square.github.io/tape/ and the Android Priority Jobqueue https://github.com/yigit/android-priority-jobqueue

Below I have compiled a list of the persistent queue implementations for iOS that I know of. Most of them are not in active development. Ping me if you want a library added to the list.

@weibel
weibel / image_optimizer.rb
Created May 13, 2015 08:46
OSX ImageOptimizer and pngquant ruby script to be run regularly by cron. Saves an image hash to prevent reprocessing of already processed images. Can be used for optimizing images in e.g. an iOS project.
module ImageOptimizer
module Optimizer
class Launch
def initialize(args)
@meta_manager = FileMeta::Manager.new(args[:db_name])
@png_optimizer = Optimizers::PNGOptimizer.new(args[:pngquant_quality_range])
end
# Use this for i.e. a rake task
def self.optimize_images
@weibel
weibel / geocoder_dalli_client.rb
Created April 18, 2013 10:22
Memcached/Dalli cache client for the Ruby Geocoder gem http://www.rubygeocoder.com/
require 'dalli/client'
require 'yaml'
class GeocoderDalliClient
def initialize
@keys = 'GeocoderDalliClientKeys'
# setup for Heroku using the memcachier gem.
# On other setups you'll have to specify the Memcached server
@dalli_client = Dalli::Client.new
end
@weibel
weibel / gist:5252703
Last active December 15, 2015 11:28
Ruby client for the Tenhands.net REST API
require 'httpi'
require 'json'
# Client for the tenhands REST API https://tenhands.net/developer/docs.htm?userId=e54a5608-961a-11e2-8866-12313d08920c#rest
class TenhandsRestClient
def initialize(adaptor = :httpclient)
@adaptor = adaptor
@api_key = 'your key'
@base_url = 'https://tenhands.net/api/v1'