Skip to content

Instantly share code, notes, and snippets.

@Nilpo
Nilpo / Android Studio Tricks.md
Created September 30, 2016 05:38 — forked from arriolac/Android Studio Tricks.md
Some Android Studio Tricks.

Android Studio Notes

Android Studio keyboard shortcuts I use often.

Keyboard Shortcuts for Mac

  • SHIFT + F6 to refactor methods, classes, and variable names
  • CTRL + O to override methods
  • COMMAND + N
    • Generate getter, setter, and constructor method for a class (when in editor pane)
@Nilpo
Nilpo / 0_reuse_code.js
Created September 17, 2016 05:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Nilpo
Nilpo / allow
Created September 16, 2016 01:40 — forked from Mteigers/allow
CSF Allow AND Ignore Cloudflare IPv4 IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done
@Nilpo
Nilpo / MapAdjust.java
Created April 19, 2016 02:54 — forked from codebutler/MapAdjust.java
Code to offset Android Google Map positions in pixels.
// MapAdjust.java
// Based on adjust.py
// Gatubit <gatubit@gmail.com>
// https://gist.github.com/astrocosa/724526
// Based on adjust.js
// Bratliff <bratliff@umich.edu>
// http://www.polyarc.us/adjust.js
@Nilpo
Nilpo / JsonHelper.java
Created April 19, 2016 02:46 — forked from codebutler/JsonHelper.java
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@Nilpo
Nilpo / gist:defc4feacbb71f79cf13
Created January 29, 2016 06:48 — forked from max/gist:5708466
Flat UI Colors as Sass variables
// I needed flatuicolors.com as Sass variables...
// In your console, run:
$('.color').get().map(function(el) { return "$" + el.classList[1] + ": " + el.getAttribute('data-clipboard-text') + ';' }).join('\r\n');
// Output:
// $turquoise: #1abc9c;
// $emerland: #2ecc71;
// $peter-river: #3498db;
// $amethyst: #9b59b6;
// $wet-asphalt: #34495e;
@Nilpo
Nilpo / ttf2woff2.md
Created December 22, 2015 23:35 — forked from sergejmueller/ttf2woff2.md
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {
@Nilpo
Nilpo / colors.xml
Last active September 12, 2022 16:50 — forked from drewis/colors.xml
Material design color palettes for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- app color palette -->
<color name="primary">@color/indigo_500</color>
<color name="primary_light">@color/indigo_100</color>
<color name="primary_dark">@color/indigo_700</color>
<color name="accent">@color/pink_A200</color>
<color name="accent_fallback_light">@color/pink_A100</color>
<color name="accent_fallback_dark">@color/pink_A400</color>
@Nilpo
Nilpo / android_material_design_colours.xml
Last active October 26, 2015 00:40 — forked from daniellevass/android_material_design_colours.xml
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>