Skip to content

Instantly share code, notes, and snippets.

Alex Barkan halfvector

Block or report user

Report or block halfvector

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am halfvector on github.
  • I am unbuffered (https://keybase.io/unbuffered) on keybase.
  • I have a public key whose fingerprint is 7A4B 8DA9 C9EB 52B4 15EA DDDF BA7F EFC2 45B4 04E7

To claim this, I am signing this object:

@halfvector
halfvector / jacocoTestReport-build.gradle
Created Sep 29, 2016
jacocoTestReport for unit + instrumentation test code coverage for Android
View jacocoTestReport-build.gradle
/**
* This JacocoTestReport task merges local Unit Tests and emulator/device Instrumentation Tests into a single coverage report.
* Also ignores Dagger 2 generated code.
* Add this task to your Android app/build.gradle and run your test suites then execute this task.
* Coverage report will appear in app/build/reports/jacoco/jacocoTestReport/
* as standard xml compatible with codecov.io and human readable html
* dependsOn: ['testDebugUnitTest', 'connectedDebugAndroidTest']
*/
task jacocoTestReport(type: JacocoReport) {
group = "Reporting"
@halfvector
halfvector / android-flat-wifi-model.java
Created Mar 16, 2016
Flattened Android Wifi model with Enterprise configuration extensions (EAP)
View android-flat-wifi-model.java
/**
* All fields are allowed to be null.
*/
class WifiConfig {
/**
* The network's SSID. Can either be an ASCII string, which must be enclosed in double quotation marks
* (e.g., "MyNetwork"), or a string of hex digits,which are not enclosed in quotes (e.g., 01a243f405).
*/
String SSID;
View git-aliases.zsh
# a few git commands
alias gs='git status'
alias gp='git push'
alias gl='git log --graph --pretty=tformat:"%C(auto)%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(auto)%d%Creset" --abbrev-commit'
alias cdiff='cdiff -s -c always | less -rFX'
# recent log entries without a pager
alias glr='git --no-pager log -25 --graph --pretty=tformat:"%C(auto)%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(auto)%d%Creset" --abbrev-commit'
alias gs='git status -s'
@halfvector
halfvector / docker-purge-containers.sh
Created Mar 25, 2015
Cleanup exited Docker containers to free up disk space
View docker-purge-containers.sh
#!/bin/sh
echo "Removing exited docker containers.."
docker ps -f status=exited -q | xargs docker rm
@halfvector
halfvector / docker-purge-images.sh
Created Mar 25, 2015
Cleanup untagged Docker images. Manual garbage collection to keep your drive from running out of space.
View docker-purge-images.sh
#!/bin/sh
echo "Removing untagged docker images.."
docker images -q -f dangling=true | xargs docker rmi
@halfvector
halfvector / intellij-beautify.md
Last active Jan 16, 2018
Android Studio & IntelliJ Beautification
View intellij-beautify.md
View keybase.md

Keybase proof

I hereby claim:

  • I am halfvector on github.
  • I am unbuffered (https://keybase.io/unbuffered) on keybase.
  • I have a public key whose fingerprint is 06A0 B06E C8DA 531E D77F 7C6A 0671 385C D805 BB2D

To claim this, I am signing this object:

@halfvector
halfvector / update-android-id.sh
Created Jul 16, 2014
update device's android_id
View update-android-id.sh
# prerequisites: rooted device, adb, sqlite installed locally
# works beautifully on glass
# android-ids are hexadecimal [0-9a-f]
# install sqlite3 locally to modify the db
sudo apt-get install -y sqlite3
# make sure we have a device connected
adb devices
@halfvector
halfvector / gist:9732963
Last active Aug 29, 2015
playing various form-gathering syntaxes
View gist:9732963
$data = $this->getRequirements([
'description' => ['type' => 'markdown', 'minLength' => 3, 'persistent' => true],
'title' => ['type' => 'string', 'minLength' => 3, 'persistent' => true],
'action' => ['type' => 'string', 'minLength' => 3],
'suggestionId' => ['type' => 'int'],
'reason' => ['type' => 'string', 'minLength' => 3, 'optional' => true, 'default' => ""],
'tags' => ['type' => 'array', 'optional' => true],
'attachments' => ['type' => 'file', 'optional' => true],
'keepAttachments' => ['type' => 'array', 'optional' => true]
]);
You can’t perform that action at this time.