Skip to content

Instantly share code, notes, and snippets.

View abatilo's full-sized avatar

Aaron Batilo abatilo

View GitHub Profile
@abatilo
abatilo / summarizePR
Created September 11, 2018 01:48
Script for nicely formatting commits from a PR
#!/bin/sh
git log --reverse --format="_**%s**_%n%n%b" master..HEAD | xclip -sel clip
echo "Summary copied to clipboard"
@abatilo
abatilo / docker-cleanup-resources.md
Created May 3, 2018 14:32 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

def fib(n):
if n == 0:
return 0
if n == 1:
return 1
return fib(n - 1) + fib(n - 2)
if __name__ == '__main__':
for _ in range(10):
print fib(_)
(ns flyr.core)
(defn fib [n]
(if (= 0 n)
0
(if (= 1 n)
1
(+ (fib (- n 1)) (fib (- n 2))))))
(defn -main []
@abatilo
abatilo / core.clj
Created January 28, 2018 15:42
Clojure fibonacci
(ns flyr.core)
(defn fib [n]
(if (= 0 n)
0
(if (= 1 n)
1
(+ (fib (- n 1)) (fib (- n 2))))))
(defn -main
@abatilo
abatilo / README-Template.md
Created November 9, 2017 01:15 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

# Deletes local branches if they don't exist on the remote
alias prune=`git fetch --prune --all && git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d`
@abatilo
abatilo / gist:ca9870ffc6c3825aecf1dd5ec7500719
Created March 16, 2017 00:47
Add to .bashrc to make committing all files and pushing easy
gac() { git add -A && git commit -m "$*" && git push; }
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment"
android:name="whatever.here.MainFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_main"
/>
@RunWith(AndroidJUnit4.class) public class FragmentTest {
// Setup an ActivityTestRule as such that the Activity is not launched until we say so
@Rule public ActivityTestRule<EmptyActivity> rule =
new ActivityTestRule<>(EmptyActivity.class, true, false);
private Fragment fragment;
private EmptyActivity activity;
@Before public void setup() {