Skip to content

Instantly share code, notes, and snippets.

View kyounger's full-sized avatar

Kenny Younger kyounger

View GitHub Profile
@kyounger
kyounger / list-fftabs.py
Last active July 30, 2020 20:03 — forked from tmonjalo/list-fftabs.py
List all Firefox tabs with title and URL
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""
@kyounger
kyounger / init.lua
Created July 25, 2020 04:45
hammerspoon draw box and obtain coordinates
hs.hotkey.bind(modShiftHyper, "W", function()
-- local tracking = false
local startingMousePosition = hs.mouse.getAbsolutePosition()
local max = hs.screen.mainScreen():fullFrame()
local maxCanvas = hs.canvas.new{x=max.x, y=max.y, h=max.h, w=max.w}
maxCanvas:clickActivating(false)
maxCanvas:canvasMouseEvents(true, true, false, true)
maxCanvas:mouseCallback(function(_, event, id, x, y)
local currentMousePosition = hs.mouse.getAbsolutePosition()
@kyounger
kyounger / example.md
Created August 12, 2019 13:10 — forked from mnutt/example.md
TreeStyleTab sidebar tabs only

Example:

firefox

@kyounger
kyounger / convert-xml.sh
Created June 7, 2019 21:03
Convert xml from ebscohost to csv using xml2json and jq
# tools required:
# npm install -g xml2json-cli
# brew install jq
# This command will flatten the resulting array of objects so that the headers are just the json path to the key joined with dots.
xml2json file.xml | jq '[.records.rec[] | . as $in | reduce leaf_paths as $path ({}; . + { ($path | map(tostring) | join(".")): $in | getpath($path) })]' | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > test2.csv

Keybase proof

I hereby claim:

  • I am kyounger on github.
  • I am kly (https://keybase.io/kly) on keybase.
  • I have a public key whose fingerprint is C1A1 BEE1 BF5E 40EB 0EF0 4D73 2CA2 217F 2FF9 C541

To claim this, I am signing this object:

@kyounger
kyounger / complex-nested-view.dsl.groovy
Created October 27, 2015 02:55
Jenkins Job DSL - example of nested view loop
def jobNames = [
'job1',
'job2',
'job3',
'job4'
]
def branches = [
'master',
'v1',
'v2',
@kyounger
kyounger / PHPFPM.Portfile
Created March 31, 2012 17:19 — forked from jasonmoo/PHPFPM.Portfile
PHP 5.3.10 MacPorts Portfile with FPM enabled FastCGI variant
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89615 2012-02-04 05:28:00Z [email protected] $
PortSystem 1.0
name php5
conflicts php5-devel php52
# Keep version of php5 in sync with bundled php5 extension ports.
# Increment revision of php5-eaccelerator when updating version of php5.
epoch 1