Skip to content

Instantly share code, notes, and snippets.

View alexpyoung's full-sized avatar

Alex Young alexpyoung

View GitHub Profile
@alexpyoung
alexpyoung / pocket_import
Last active August 13, 2020 08:53
Import Safari Reading List Into Pocket
#!/usr/bin/env python3
import logging
import os
import plistlib
import requests
import sys
import webbrowser
@alexpyoung
alexpyoung / papertrail.sh
Last active July 17, 2019 17:22
Search for PaperTrail system and follow logs
# Dependencies
# PaperTrail CLI: https://github.com/papertrail/papertrail-cli#quick-start
# fzf and jq
curl -s -H "X-Papertrail-Token: $PAPERTRAIL_API_TOKEN" https://papertrailapp.com/api/v1/groups.json \
| jq -r '.[0].systems | map(.name) | .[]' \
| fzf \
| xargs papertrail -f -s
import json
import pprint
import sys
pretty = pprint.PrettyPrinter(indent=4, width=200)
"""
Returns a map of permissions keyed by entity id
"""
def transform(entity_permissions):
[
{
"scoping_entity_type": "team",
"scoping_entity_id": "b9483863-9292-4158-a685-69c8d7d32ee9",
"permissions": [
{
"permission_entity_type": "schedule_event",
"permission_action": "update"
},
{
final class JSONLoader {
static func path(forResource name: String) throws -> String {
let bundle = NSBundle(forClass: JSONLoader.self)
guard let path = bundle.pathForResource(name, ofType: "json") else {
// TODO
throw
}
return path
}
@alexpyoung
alexpyoung / swiftlint_diff.sh
Created October 11, 2016 03:06
SwiftLint git diff
# Run SwiftLint
START_DATE=$(date +"%s")
SWIFT_LINT=/usr/local/bin/swiftlint
# Run SwiftLint for given filename
run_swiftlint() {
local filename="${1}"
if [[ "${filename##*.}" == "swift" ]]; then
${SWIFT_LINT} autocorrect --path "${filename}"
@alexpyoung
alexpyoung / ai-standup-log.md
Last active August 29, 2015 14:24
A.I. Stand-Up Log

##Tuesday, July 14, 2015

####Working On

#####Akash

  • OOO

#####Alex

  • Debugging video and transcode profile modeling
  • Bug fixing for quality selector feature
@alexpyoung
alexpyoung / breakpoints.js
Created February 21, 2015 17:52
Breakpoints
var pkg = require('../../package.json');
/* Fetch angular from the browser scope */
var angular = window.angular;
var IntelligenceWebClient = angular.module(pkg.name);
// Values in px
var BREAKPOINTS = {