Skip to content

Instantly share code, notes, and snippets.


Jett Robin Andres jettandres

View GitHub Profile
seeliang / lint-only-changed-files.MD
Last active December 14, 2022 14:31
How to lint only changed files?
View lint-only-changed-files.MD

Updated on medium

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

bbqtd /
Last active February 6, 2023 02:33
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

gaearon /
Last active February 2, 2023 22:49
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](
View url-schemes-settings-ios.mkd


Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.


  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
jk2K /
Last active April 24, 2022 03:13 — forked from medyo/
how to export realm database, work on Android 5.0+
NOT_PRESENT="List of devices attached"
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'`
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then
echo "Make sure a device is connected"
danomanion /
Created October 8, 2015 15:41
The Millionaire Fastlane Commandments CENTS.

The Millionaire Fastlane Commandments CENTS.


An Entrepreneur is someone who solves problems through scalable solutions.

C (Control)

  • Do you own the land you build your business on? Could someone slip the carpet from right under you?
  • Are you reliant on a single platform like Amazon, YouTube, Google Organic Search alone?
  • If 90% of your sales are based on one single platform like Amazon, they could kick you off and kill your business.
  • If 100% of your business comes from an organic Google algorithm and that algorithm changes, you are in trouble.
mbalex99 / gist:8802db1695f20c520ca0
Last active May 22, 2022 11:58
Alamofire and RxSwift
View gist:8802db1695f20c520ca0
let rx_request = Observable<Value>.create { (observer) -> Disposable in
let requestReference = Alamofire.request(.POST, url, parameters: payload)
.responseJSON(completionHandler: { (response) in
if let value = response.result.value {
}else if let error = response.result.error {
benbahrenburg /
Last active January 16, 2023 09:50
iOS 8: Geo Location Permissions Fix

Fixing Geo Location Permissions in iOS8

In iOS8, Apple has changed how geo location permissions work. This gist outlines an approach to fix this so Geo will continue to work in iOS8.

Before getting started with the code change, we need to update the tiapp.xml with a few keys.

If you wish to have Geo always run, you need to add the below key. The key NSLocationAlwaysUsageDescription is used when requesting permission to use location services whenever the app is running. To enable this, add the below to the tiapp.xml:

NSLocationAlwaysUsageDescription Reason that appears in the authorization prompt

staltz /
Last active February 6, 2023 06:39
The introduction to Reactive Programming you've been missing
shadcn / gist:de147c42d7b3063ef7bc
Last active September 17, 2022 11:50
Convert a Hex string to UIColor in Swift
View gist:de147c42d7b3063ef7bc
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
if (countElements(cString) != 6) {
return UIColor.grayColor()