Skip to content

Instantly share code, notes, and snippets.

Just do it!

Hossain Khan amardeshbd

Just do it!
View GitHub Profile
alopresto /
Last active May 13, 2021
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
JakeWharton /
Last active Apr 21, 2021
A comparison between non-capturing and capturing expressions across Java 6, Java 8, Java 8 with Retrolambda, Kotlin with native function expressions, and Kotlin with Java SAM expression.
import java.util.Arrays;
class NonCapturing {
public static void main(String... args) {
run(new Runnable() {
@Override public void run() {
JakeWharton / gist:f50f3b4d87e57d8e96e9
Created Feb 7, 2015
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
View gist:f50f3b4d87e57d8e96e9
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
public static void riseAndShine(Activity activity) {
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
macsystems /
Last active Jan 20, 2020
If you want to parse an RSS Feed using SimpleXML you can use this as an Start. I used this to parse RSS using RetroFit from Square
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.NamespaceList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Text;
import java.util.List;
kevinSuttle /
Last active Apr 25, 2021 — forked from lancejpollard/
List of Usable HTML Meta and Link Tags
fredgrott / eclipse-checkstyle-android-best-practices
Created Apr 29, 2011
eclipse checkstyle checks for android
View eclipse-checkstyle-android-best-practices
<?xml version="1.0"?>
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
Checkstyle-Configuration: Android checkstyle by Enea
Description: none