Skip to content

Instantly share code, notes, and snippets.

View bimusiek's full-sized avatar

Michal Hernas bimusiek

View GitHub Profile
@bimusiek
bimusiek / racecondition_testcase.py
Last active January 4, 2018 15:53
Race conditions Django Test Case
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import logging
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import connections
@bimusiek
bimusiek / keybase.md
Created September 13, 2017 09:22
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@bimusiek
bimusiek / SpotifyApi.swift
Created March 6, 2016 14:02
SpotifyAPI helper in Swift
import Foundation
import Alamofire
import RxSwift
import SwiftyJSON
class SpotifyAPI {
let accessToken:String
let url:String
let params:[String:AnyObject]
@bimusiek
bimusiek / README.md
Created February 28, 2015 22:05
Closest location (lat & long) with Postgresql in Django

Distance calculation

Example how to calculate distance and then take closest location.

Can be further imporved by first filtering locations to some square withing min & max lat & long. So we are not calculating distance for all locations.

I know you could use some greate Geo engine for PostgreSQL or Django but I needed fast, working solution. Feel free to use

License

MIT

@bimusiek
bimusiek / gist:43dad861801aa0c62288
Created February 26, 2015 16:56
Swift allows override public method with private one
//Original file
class GiftCardPaymentViewController{
public func nextStep() {
[...]
}
}
// Some testcase
class GiftCardPaymentTest:XCTestCase {
func testIt() {
@bimusiek
bimusiek / upload_itunes_connect.sh
Created November 28, 2014 14:49
Upload app to iTunesConnect
#!/bin/bash
set -ex
# Based on other gist, fixed issue with typo and added argument for APP_ID.
# Your username and password should be set as environment variable $ITUNESCONNECT_LOGIN and $ITUNESCONNECT_PASSWORD
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html