Skip to content

Instantly share code, notes, and snippets.


Daniel Gomez danielgomezrico

View GitHub Profile
rock3r /
Last active Mar 8, 2021
Giffify - easily create optimised GIFs from a video
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile
mbalex99 / gist:8802db1695f20c520ca0
Last active Jan 29, 2020
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 {
ashleymills / UIApplication+AppVersion.swift
Last active Feb 29, 2020
UIApplication extension to get app version / build
View UIApplication+AppVersion.swift
extension UIApplication {
class func appVersion() -> String {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
class func appBuild() -> String {
return Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as! String
yqritc / gist:ccca77dc42f2364777e1
Last active May 14, 2021
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration
View gist:ccca77dc42f2364777e1


public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
geekmanager / make-git-use-sublime.markdown
Last active Jun 6, 2021
Making git use Sublime Text for rebase etc
View make-git-use-sublime.markdown

Making git use Sublime Text

First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to subl which is the launcher from terminal:

ln -s /Applications/Sublime\ Text\ /usr/local/bin/sublime

(added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink).

If there's any chance that bash doesn't check usr/local/bin then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen.

JoanZapata /
Created Feb 5, 2015
Util for using MapView instead of MapFragment and still avoid boilerplate code to delegate all the activity lifecycle (onCreate, onResume, onPause, onDestroy, etc...) to the MapView.
import android.os.Bundle;
import static java.lang.String.format;
public class MapsUtils {
View res_color_btn_flat_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">
<item android:state_enabled="false"
<item android:color="@color/flat_normal_text"/>
lapastillaroja /
Last active May 30, 2021 — forked from akmalxxx/
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
View Android CI
#Android and CI and Gradle (A How-To)
There are tech stacks in this world that make it dead simple to integrate a <abbr title="Continuous Integration">CI</abbr> build system. <br>
The Android platform is not one of them.
Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming.
But fear not! It can be done!
Before we embark on our journey, you'll need a few things to run locally:
ZevEisenberg /
Last active May 20, 2021
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all