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
| #!/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
| #!/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
| 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
| Single Post | |
| ======= | |
| **GET** */api/v1/news/[guid].json?uuid=00xsd* | |
| ```json | |
| { | |
| "guid": 213124, | |
| "title": "Some title news about sth", | |
| "content": "Current content field", | |
| "body": "some long article body...", |
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
| # add tou your ~/.profile file | |
| cpToDropbox() | |
| { | |
| cp $1 /Users/michal/Dropbox/destination_folder | |
| echo 'File copied to Dropbox folder' | |
| } | |
| alias drop=cpToDropbox |
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 path='echo | pwd | pbcopy' | |
| alias pong='cd `pbpaste`' |
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
| # GIT aliases | |
| alias doMastera='git push origin HEAD:refs/for/master' | |
| alias zrobFetcha='git fetch origin master && git checkout FETCH_HEAD' | |
| alias gst='git status' | |
| alias gd='git diff' | |
| alias gl='git lg' | |
| alias resetuj='git reset --hard HEAD' | |
| alias amenduj='git commit --amend' | |
| alias vim='~/Developments/vim/src/vim' | |
| alias testuj='./gradlew connectedInstrumentTest' |
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
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| requestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY); | |
| super.onCreate(savedInstanceState); | |
| mAppPreferences = new AppPreferences(this); | |
| mUserPreferences = new UserPreferences(this); | |
| DownloadHelper.startAsyncDownload(getApplicationContext(), | |
| AppConsts.ACTION_SYNC, AppContract.Category.CONTENT_URI, null, |
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
| // Add this template in Preferences > Java > Editor > Templates > New | |
| // I stored this snippet with newRequest name, but you can use any name you want | |
| String url = new GetBuilder(${url}).appendPathSegment(${path}) | |
| .build(); | |
| Http${type} request = new Http${type}(url); | |
| setupDefaultHeaders(request); | |
| HttpResponse response = getHttpClient().execute(request); |