Skip to content

Instantly share code, notes, and snippets.

@fpillet
fpillet / Results+Rx.swift
Created February 13, 2016 17:23
turn Realm auto-updating Results into an RxSwift Observable sequence
//
// Results+Rx.swift
//
// Make Realm auto-updating Results observable. Works with Realm 0.98 and later, RxSwift 2.1.0 and later.
//
// Created by Florent Pillet on 12/02/16.
// Copyright (c) 2016 Florent Pillet. All rights reserved.
//
import Foundation
@neworld
neworld / howto.md
Last active September 15, 2020 11:32
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
@tmspzz
tmspzz / ParameterEncodingExt.swift
Last active October 24, 2017 10:43
Alamofire-GZIP-ParameterEncoding
// Actual gzipping from https://github.com/1024jp/NSData-GZIP
// Example: ParameterEncoding.JSON.gzipped
infix operator { associativity left }
func <A, B, C>(f: B -> C, g: A -> B) -> A -> C {
return { x in f(g(x)) }
}
extension ParameterEncoding {
@artzub
artzub / make.sh
Last active November 30, 2022 11:41
Install JetBrains Hub + YouTrack + UpSource + Nginx
#!/bin/bash
apt-get install mc htop git unzip wget curl -y
echo
echo "====================================================="
echo " WELCOME"
echo "====================================================="
echo
echo "Hub"
@VictorLaskin
VictorLaskin / Dockerfile
Created July 5, 2015 12:24
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
# THIS DOCKERFILE TRIES TO COMPILE CURL/OPENSSL FOR ANDROID
#
# 5 july 2015
#
# More detals could be found here:
# http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/
FROM ubuntu
MAINTAINER Victor Laskin "victor.laskin@gmail.com"
@sjones94549
sjones94549 / Multiple_GCM_Senders.md
Last active November 13, 2017 01:18
How to handle multiple GCM senders in the same app

Multiple GCM Senders in the Same App

Google does support multiple GCM senders (Layer, etc.) for a single app, but you have to account for it. If not, one or more GCM sender will fail to send GCM intents, and GCM intents that do come in may randomly fail to reach GCM receivers in your manifest.

GCM Registration

GCM registration happens in two phases. First, the device supplies a Sender ID to Google, and Google gives the device back a Registration ID. The Registration ID is what the device sends to Layer so we can send GCM to that device. The trick is, each app can only have one current Registration ID assigned by Google at a time; previously assigned Registration IDs will no longer work. And, the Registration ID is based on the Sender ID supplied at registration time. So, if multiple senders (e.g. Layer and another service) register for GCM, one will register last and invalidate the other.

Option 1: Handling GCM Registration Yourself

The first method is documented:

@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@chaitanyagupta
chaitanyagupta / re-sign-ios-app.md
Last active October 20, 2023 08:28
How to re-sign an iOS app with another developer account

WARNING These steps are probably out dated and will not work.

To re-sign an iOS app with another developer account, ensure that the following are in place first.

  1. Distribution certificate of the other developer account
  2. A provisioning profile from the other developer account

Note that the Apple requires bundle IDs to be globally unique, even across accounts. So a bundle ID i.e. CFBundleIdentifier from one account can't be used in a different account, even though the team id/prefix would be different.

Ensure that the new distribution certificate is in your keychain and the new provisioning profile on your disk.

@SlaunchaMan
SlaunchaMan / build.sh
Last active February 21, 2019 08:34
Enumerate all schemes in a project, archive them, and export as IPAs.
#!/bin/bash
# Builds all targets and places IPAs in build/
# Constants
SIGNING_IDENTITY="iPhone Distribution: Detroit Labs, LLC"
# Get a list of all schemes, then build each.
xcodebuild -project PROJECT.xcodeproj -list | \
sed -n '/Schemes/,/^$/p' | \
@rxaviers
rxaviers / gist:7360908
Last active April 16, 2024 06:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: