This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void setText(String html) { | |
| SpannableStringBuilder spanned = (SpannableStringBuilder) Html.fromHtml(html); | |
| spanned = trimSpannable(spanned); | |
| mTextView.setText(spanned, TextView.BufferType.SPANNABLE); | |
| } | |
| private SpannableStringBuilder trimSpannable(SpannableStringBuilder spannable) { | |
| checkNotNull(spannable); | |
| int trimStart = 0; | |
| int trimEnd = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rmagick' | |
| require 'fileutils' | |
| start = Time.now.to_i | |
| file_name = ARGV[0] | |
| img = Magick::Image::read(file_name)[0] | |
| output = img.scale(0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # save file as .git/hooks/prepare-commit-msg | |
| BRANCH=$(git symbolic-ref --short HEAD) | |
| TICKET=`echo $BRANCH | grep -o 'MOB-\d\{1,\}'` | |
| status=$? | |
| if [ $status -eq 0 ] ; then | |
| echo "[$TICKET]\n$(cat $1)" > $1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for package_name in `adb shell pm list packages | grep -o com.wikia.[a-zA-Z\.]*` ; do | |
| adb devices | tail -n +2 | awk '{print $1}' | xargs -i adb -s {} uninstall $package_name > /dev/null 2>&1 | |
| status=$? | |
| if [ $status -eq 0 ] ; then | |
| echo "[REMOVED] $package_name" | |
| fi | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
| co = checkout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias gst='git status' | |
| alias gd='git diff' | |
| alias gl='git lg' | |
| c_cyan=`tput setaf 6` | |
| c_red=`tput setaf 1` | |
| c_green=`tput setaf 2` | |
| c_light_red="$(tput setab 1)" | |
| c_sgr0=`tput sgr0` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # save file in .git/hooks/prepare-commit-msg | |
| # chmod +x prepare-commit-msg | |
| BRANCH=$(git symbolic-ref --short HEAD) | |
| TICKET=`echo $BRANCH | grep -o 'MOB-\d\{1,\}'` | |
| status=$? | |
| if [ $status -eq 0 ] ; then | |
| echo "[$TICKET]\n$(cat $1)" > $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def getCommitId() { | |
| def output = new ByteArrayOutputStream() | |
| exec { | |
| commandLine 'git', 'rev-parse', '--short', 'HEAD' | |
| standardOutput = output | |
| } | |
| return output.toString() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task wrapper(type: Wrapper) { | |
| gradleVersion = '2.4' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In App class | |
| public void onCreate() { | |
| applicationComponent = initializeAppComponentBuilder().build(); | |
| applicationComponent.inject(this); | |
| } | |
| protected DaggerAppComponent.Builder initializeAppComponentBuilder() { | |
| return DaggerAppComponent.builder() | |
| .applicationModule(new ApplicationModule(this)) | |
| .networkModule(new RealNetworkModule()) |