Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Gomez danielgomezrico

View GitHub Profile
@danielgomezrico
danielgomezrico / rbenv-install-system-wide.sh
Last active Feb 5, 2018 — forked from tomazzlender/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu to /opt/rbenv
View rbenv-install-system-wide.sh
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/rbenv/rbenv.git /opt/rbenv
# Add rbenv to the path:
@danielgomezrico
danielgomezrico / add local aar file.md
Created Jan 21, 2017 — forked from shau-lok/add local aar file.md
Android Studio add local .aar reference
View add local aar file.md

Add local .aar file

  1. basic build.gradle directory using flatDir
repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
@danielgomezrico
danielgomezrico / make-git-use-sublime.markdown
Created Oct 25, 2016 — forked from geekmanager/make-git-use-sublime.markdown
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\ 2.app/Contents/SharedSupport/bin/subl /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.

@danielgomezrico
danielgomezrico / completion-for-gradle.md
Created Jul 26, 2016 — forked from nolanlawson/completion-for-gradle.md
Gradle tab completion for Bash. Works on both Mac and Linux.
View completion-for-gradle.md

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]
@danielgomezrico
danielgomezrico / demo.sh
Created Jul 4, 2016 — forked from rock3r/README.md
A simple bash script to enable demo mode on a Marshmallow+ device via ADB (based on http://bit.ly/295BHLx)
View demo.sh
#!/bin/sh
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi 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.
#
# Based on http://bit.ly/295BHLx
@danielgomezrico
danielgomezrico / AlphaTransformation.java
Last active Jun 6, 2016 — forked from r0adkll/ShadeTransform.java
Android - alpha/shadow transformation for Picasso (This allows you to draw a transparent black shade over the source image)
View AlphaTransformation.java
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import com.squareup.picasso.Transformation;
public class AlphaTransformation implements Transformation {
/* The shade alpha of black to apply */
@danielgomezrico
danielgomezrico / git-author-rewrite.sh
Last active Apr 4, 2019 — forked from octocat/git-author-rewrite.sh
Git - Replace all author name/email with same old_email (by branch)
View git-author-rewrite.sh
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@danielgomezrico
danielgomezrico / pre-commit.sh
Last active Feb 12, 2016 — forked from chadmaughan/pre-commit.sh
A git pre commit hook that runs the test task with the gradle wrapper
View pre-commit.sh
#!/usr/bin/env bash
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
@danielgomezrico
danielgomezrico / CircleTransform.java
Last active Feb 25, 2016 — forked from dtygel/CircleTransform.java
CircleTransform for Picasso
View CircleTransform.java
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software