Skip to content

Instantly share code, notes, and snippets.

View akrabat's full-sized avatar

Rob Allen akrabat

View GitHub Profile
#!/usr/bin/env ruby -wKU
# Comments added 6 March 2014.
# Implementation of the MetaWeblog API for my personal Ruby static blog generator.
# This is not even nearly idiomatic Ruby. There are all kinds of issues.
# (What's with the method interiors all being mushed-up together?)
# But -- it's also worked flawlessly for five years without my having to edit it.
# It won't work for anyone else as-is — but if it helps anyone
# to do a MetaWeblog API implementation, then cool.
@lrytz
lrytz / z-automator.png
Last active October 15, 2024 06:31
Shortcut for Syntax Highlighting in Keynote
@listrophy
listrophy / Glob.swift
Created June 25, 2015 17:14
Wrap glob(3) in Swift
//
// Glob.swift
//
// Created by Brad Grzesiak on 6/25/15.
// Copyright © 2015 Bendyworks Inc.
// Released under the Apache v2 License.
//
import Foundation
@sgolemon
sgolemon / gist:0e1ea13a16d21098e73f
Last active August 29, 2015 14:23
Questionable use of GitHub APIs

Over-reacted to second hand info and misinterpreted docs.

I do think OAuth providers (like Github, Twitter, Facebook, etc...) should do more to discourage apps from requesting write access. It PARTICULARLY disturbs me that admin:public_key is even an option in Github's Scopes. So the potential for disasterous outcomes certainly exists when granting access to apps via Github's OAuth system, but provided that you carefully read what you're granting access to, it's not necessarily as bad a my original post (left intact below) made it out.


During a twitter conversation[1] this morning, I discovered that in order for an application to get something as simple as your name during a single-sign on, it has to ask for full user profile information. That's a bit scary by itself, but when asking for full profile information, it also has to ask for read and WRITE permissions.[2]

Yes, in order to use single-signon to a 3rd party site, I have to give that site the rights to modify my email addr

@brbsix
brbsix / README.md
Last active December 27, 2021 22:33
Networking Troubles with Vagrant Box ubuntu/wily64

Networking Troubles with Vagrant Box ubuntu/wily64

For some reason, the network interfaces in ubuntu/wily64 fail to configure at boot. The interfaces are renamed during boot, with dmesg reporting things like udev renamed network interface eth0 to enp1s0. This is apparently the result of a change in systemd. You can read about it here:

Starting with v197 systemd/udev will automatically assign predictable, stable network interface names for all local Ethernet, WLAN and WWAN interfaces. This is a departure from the traditional interface naming scheme ("eth0", "eth1", "wlan0", ...), but should fix real problems.

http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/


import Glibc
// Swift 3 version here: https://gist.github.com/erica/7aee99db9753a1636e0fbed8d68b5845
/*
Did a bunch of tweaks this morning:
removed == true (sorry Kametrixom!)
cleaned up both stringFromBytes and bytesFromString
changed fperror check to guard
replaced use of 1024 in several places with a single constant
@asgrim
asgrim / pre-commit
Created December 31, 2015 11:46
Never commit a broken test again...
#!/bin/bash
echo -n "Running phpunit... "
vendor/bin/phpunit --stop-on-failure --stop-on-error > /dev/null
if [ $? -ne 0 ]
then
echo "[FAILED]"
exit 1
fi
let digs: Set<Character> = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
extension String {
var firstNum: Int? {
return self
.characters
.indexOf(digs.contains)
.map(characters.suffixFrom)
.flatMap { cs in
Int(String(cs.prefixUpTo(cs.indexOf { c in !digs.contains(c) } ?? cs.endIndex)))
@bezhermoso
bezhermoso / notification-actions.applescript
Last active February 11, 2023 09:54
Handly AppleScripts to manage OS X notifications. (Use in Automator, bind to keyboard shortcuts via BetterTouchTool, etc.) Inspired by http://apple.stackexchange.com/a/155736
# Close all notifications
my closeNotifications()
on closeNotifications()
tell application "System Events" to tell process "Notification Center"
set theWindows to every window
repeat with i from 1 to number of items in theWindows
set this_item to item i of theWindows
try
click button 1 of this_item
#!/bin/bash
#
# Faster toolchain build: skips as much as possible.
#
# To use this toolchain from the command line:"
# export TOOLCHAINS=$(whoami)
#
# we build to the same prefix every time (instead of building
# to a versioned prefix) because every time the prefix changes
# *everything* rebuilds.