Skip to content

Instantly share code, notes, and snippets.

View robertoestivill's full-sized avatar

Roberto Estivill robertoestivill

View GitHub Profile
/**
* Podes llamar al PreferenceHelper desde cualquier lado de codigo, aun sin un contexto.
*
*/
public MyFragment extends Fragment{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
...
@robertoestivill
robertoestivill / Reason
Last active May 4, 2016 01:03
Intellij Case Sensitivity Warning Fix
This is a quick fix for the IntelliJ / AndroidStudio case sensitivity warning.
https://confluence.jetbrains.com/display/IDEADEV/Filesystem+Case-Sensitivity+Mismatch
This warning comes up everytime after platform updates, and it is display when projects are located in case sensitive partition.
@robertoestivill
robertoestivill / Main class
Last active August 29, 2015 14:26
Object to KML
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
@robertoestivill
robertoestivill / aca kml
Last active August 29, 2015 14:26
Estaciones de servicio y paradores A.C.A en KML
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document> <Style id="aca"> <IconStyle>
<Icon>
<href>http://miraargentina.com/components/com_jreviews_addons/geomaps/icons/aca.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="campingsite"> <IconStyle>
<Icon>
@robertoestivill
robertoestivill / themes-debug.xml
Last active June 18, 2018 13:57 — forked from dlew/themes-debug.xml
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>
@robertoestivill
robertoestivill / .profile
Last active November 9, 2022 22:17
Fix Android Studio Case Sensitive IDE Warning on OSx
alias intellij-case-patch='printf '\''\nidea.case.sensitive.fs=true'\'' >> /Applications/Android\ Studio.app/Contents/bin/idea.properties'
@robertoestivill
robertoestivill / launcher.sh
Last active November 7, 2019 18:45
Bash alternative to Franz
#!/bin/bash
open -a "Google Chrome" --new --args --new-window \
'https://tweetdeck.twitter.com' \
'https://web.whatsapp.com' \
'https://blastersystems.slack.com/' \
'https://www.messenger.com/' \
'https://web.telegram.org/' \
'https://web.skype.com' \
'https://hangouts.google.com/' \
@robertoestivill
robertoestivill / hide_apple_apps.sh
Last active April 8, 2018 10:13
Hide Apple apps
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
declare -a arr=(
"Calendar.app"
"Chess.app"
@robertoestivill
robertoestivill / gist:eec8d899d4d148d879b096de2f72f2ea
Last active April 29, 2017 22:34
android-things-panic-button
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>You just got your ass saved!</Say>
</Response>
@robertoestivill
robertoestivill / branchy.sh
Created July 17, 2017 11:15
Iterate over local git branches and prompt the user for deletion confirmation.
#!/bin/bash
CURRENT=$(git branch | grep "*" | cut -c3-)
printf "Your current branch is '$CURRENT'. Will be ignored.\n\n"
BRANCHES=$(git branch | cut -c3-)
BRANCHES=${BRANCHES[@]/$CURRENT}
for BRANCH in ${BRANCHES}
do