Skip to content

Instantly share code, notes, and snippets.

View jakob-stoeck's full-sized avatar
🥋
git happens

Jakob Stoeck jakob-stoeck

🥋
git happens
View GitHub Profile
@jakob-stoeck
jakob-stoeck / brew-upgrade-parallel.sh
Last active February 26, 2024 07:07
homebrew parallel download and update
brew outdated | parallel --keep-order brew fetch --deps && brew upgrade
# without GNU parallel (output will be out of order):
brew outdated -q | xargs -L1 -P8 brew fetch --deps
@jakob-stoeck
jakob-stoeck / vpn.sh
Last active December 11, 2020 05:55
Autofill Cisco VPN password saved in macOS keychain
#!/bin/sh
if [[ $# < 2 ]]; then
echo "Use password saved in macOS keychain for Cisco VPNs"
echo "$0 usage: myscript vpnname keychainitem [close_second_window]"
exit 1
fi
VPNName=$1 # match the name of the VPN service to run
keychainItem=$2 # this name has to match "Account" for the entry you make in keychain
password=$(security find-generic-password -wl "$keychainItem")
@jakob-stoeck
jakob-stoeck / streamtester.php
Created February 7, 2017 12:06
stream tester
<?php
// You can use this file to test different video products in different players
// choose product and options
$product = 'hls'; // hls|stream_packaging|vod
$secure = true;
$staging = false;
$URLonly = false; // true to output only URL, false to output HTML
// no changes required below santa claus - happy holidays 2016
@jakob-stoeck
jakob-stoeck / parse-push-events-export.js
Created November 25, 2016 17:24
Export Parse Push Events
// Export Parse Push Events
// log into http://parse.com and run this code in your web console
// the pushes will be inside window.pushes
(function() {
const parseApp = '[YOUR_PARSE_APP_NAME]'; // the string in the URL https://parse.com/apps/[PARSE_APP]/ e.g. 'push-tests--2'
const entries = 10;
'use strict';
function get(theUrl) {
return new Promise(
@jakob-stoeck
jakob-stoeck / events.html
Last active August 29, 2015 13:56
show fb photos grouped by event. use with localhost:8080 (e.g. `python -m SimpleHTTPServer 8080`)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FB Events</title>
</head>
<body>
<div id="pictures"></div>
<div id="fb-root"></div>
@jakob-stoeck
jakob-stoeck / Copy as textile
Created October 29, 2013 17:52
Copies SequelPro results as a textile table to use it in Redmine or other textile-supported systems. To use, just copy it into your SequelPro Bundle Editor.
#!/usr/bin/php
<?php
$in = fopen('php://stdin', 'r');
$result=array();
$format='_.';
while($line=fgetcsv($in, 0, "\t")) {
$result[]='|'.$format.implode('|'.$format, $line).'|';
$format='';
}
fclose($in);
#!/bin/bash
# Script to use with git bisect for phpunit tests for yii apps
#
# Should lie under protected/tests
# usage:
#
# git bisect start __bad__ __good__ --
# git bisect run protected/tests/git-bisect-phpunit.sh __args__
#
# where __args__ are phpunit arguments:
@jakob-stoeck
jakob-stoeck / U.S. - umlauts without dead keys.keylayout
Last active December 11, 2015 07:28
Mac OS X U.S. keyboard layout with German umlauts without dead keys: alt-u -> ü, alt-shift-u -> Ü. # Installation 1. Place into ~/Library/Keyboard Layouts/U.S. - umlauts without dead keys.keylayout 2. Log out and log in again 3. Select keyboard layout in System Preferences
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Created by Ukelele version 2.2.4 on 2013-01-18 at 18:00 (MEZ)-->
<!--Last edited by Ukelele version 2.2.4 on 2013-01-18 at 18:01 (MEZ)-->
<keyboard group="0" id="5591" name="U.S. - without dead keys" maxout="1">
<layouts>
<layout first="0" last="17" modifiers="f4" mapSet="16c"/>
<layout first="18" last="18" modifiers="f4" mapSet="984"/>
<layout first="21" last="23" modifiers="f4" mapSet="984"/>
<layout first="30" last="30" modifiers="f4" mapSet="984"/>
@jakob-stoeck
jakob-stoeck / gist:3142547
Created July 19, 2012 09:17
redmine set ticket status bookmarklet
javascript:document.getElementById('issue_status_id').selectedIndex=5;document.getElementById('issue-form').submit();
@jakob-stoeck
jakob-stoeck / gist:2140868
Created March 20, 2012 20:18
use z to open macos folders (go to with regex)
# add to your ~/.profile
. ~/sources/z/z.sh
zz () { (z $* && open .); }
# "$ z some_folder" now goes to that folder in the Terminal
# "$ zz some_folder" opens this folder in the Finder