Skip to content

Instantly share code, notes, and snippets.

View pfmaggi's full-sized avatar

Pietro F. Maggi pfmaggi

View GitHub Profile
@pfmaggi
pfmaggi / MyWorkTest.kt
Created March 20, 2019 15:56
Sample implementation for testing CoroutineWorker from the WorkManager library
/*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
python -m SimpleHTTPServer 8080

If you want to only serve on localhost you'll need to write a custom Python program such as:

import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
@pfmaggi
pfmaggi / Git_pieces.md
Last active February 11, 2016 13:40
Git bits and Pieces

Create a tag and push it to remote

First we can list the current tags

git tag

Then we create a new tag

git tag <tag_name>
@pfmaggi
pfmaggi / screenshot.sh
Created September 2, 2014 18:31
Capturing screenshot images from Android devices through ADB
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png