Skip to content

Instantly share code, notes, and snippets.

View kevana's full-sized avatar

Kevan Ahlquist kevana

View GitHub Profile
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 11, 2024 08:56
Swift Concurrency Manifesto

How Do I Into Git?

a helpful primer for users sick of git's poorly-named commands

I've used Git since 2011, and this is the stuff that I've always had to Google to remember. I hope it helps you not hate Git so much.

Learning About the Repo

Learning About History

@mplewis
mplewis / macshots.py
Last active August 29, 2015 14:17
Like CloudApp, but for imgur, and free. License: MIT. Don't forget: pip3 install appdirs imgurpython watchdog pync
#!/usr/bin/env python3
import appdirs
from imgurpython import ImgurClient
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from pync import Notifier
import os
import json
@kevana
kevana / books.md
Last active October 13, 2016 05:30
Books I've already read
  • Laws of Simplicity
  • Designing for Emotion
  • The Age of the Platform
  • Design of Everyday Things
  • Release It!
  • Mythical Man Month
  • Peopleware
  • Inspired
  • Agile Project Management with Scrum
  • Distributed Systems, principles and paradigms
@Tenzer
Tenzer / README.md
Created February 18, 2015 21:20
Docker Registry S3 cleanup script

Docker Registry S3 cleanup script

This simply requires you to install the boto3 package and set the DOCKER_BUCKET variable to point at the bucket you would like to clean up, and the rest should be handled automatically. That's is presuming you have credentials to manage the S3 bucket in one of the default locations where Boto go to look for them.

Since the script more or less traverses through your entire S3 bucket, it probably makes sense to only run it infrequently, like daily or weekly, depending on the amount of repositories and layers you have and the amount of updates on the registry in total.

@mpasternacki
mpasternacki / freebsd_on_mbp.md
Created January 23, 2015 17:12
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

@ssinss
ssinss / EndlessRecyclerOnScrollListener.java
Last active January 19, 2024 08:52
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@mplewis
mplewis / safe_schedule.py
Last active April 23, 2024 01:12
An implementation of Scheduler that catches jobs that fail. For use with https://github.com/dbader/schedule
import logging
from traceback import format_exc
import datetime
from schedule import Scheduler
logger = logging.getLogger('schedule')
@spikeheap
spikeheap / build.gradle
Last active April 11, 2020 19:05
Gradle build script to install NodeJS packages and Bower dependencies. This assumes you create package.json (nodejs) and bower.json files in the root of your project.
import org.gradle.api.tasks.Exec
defaultTasks 'bower'
// Get the path for the locally installed binaries
task npmBin << {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'npm'
args = ['bin']
@jmoiron
jmoiron / blargparse.py
Created September 12, 2013 21:02
allow certain arguments to short circuit required positional arguments and other argparse errors
#!/usr/bin/env python
# I had a script which I wanted to have a special option that short-circuited the normal
# argument parsing error handling behavior so that it could be run without thenormal
# required arguments. This option would work similar to how `--help` or `--version`
# works, except that the parser would return a valid args object in its presence
# rather than exiting the program.
import argparse