Skip to content

Instantly share code, notes, and snippets.

@BrettBukowski
BrettBukowski / delay.swift
Created November 30, 2016 20:28
async delay - swift 3
let delayInSeconds = 2.0
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delayInSeconds) {
// Code
}
@BrettBukowski
BrettBukowski / applications.txt
Created January 15, 2015 16:29
Currently installed apps
/Applications/1Password 5.app
/Applications/Adium.app
/Applications/Adobe/Adobe AIR Installer.app
/Applications/Airmail.app
/Applications/Amazon Music.app
/Applications/App Store.app
/Applications/Apptivate.app
/Applications/Atom.app
/Applications/Automator.app
/Applications/Bartender.app
@BrettBukowski
BrettBukowski / extend.js
Created January 6, 2015 21:58
JS extend
"use strict";
module.exports = function (props) {
var self = this;
function Child () {
self.call(this);
}
Child.prototype = Object.create(self.prototype);
@BrettBukowski
BrettBukowski / bitbucketlogger.rb
Created January 4, 2015 04:27
Bitbucket plugin for slogger
=begin
Plugin: Bitbucket Logger
Version: 1.0
Description: Logs daily Bitbucket activity for the specified user
Author: [Brett Bukowski](http://brettbukowski.com)
Configuration:
bitbucket_user: bitbucketuser
oauth_token: oauthtoken
oauth_token_secret: oauthtokensecret
client_key: client key
@BrettBukowski
BrettBukowski / deploy.rb
Created November 6, 2014 16:45
Add a confirmation to capistrano deploys
set :confirm_keys, lambda {
puts "This is the config file that will be uploaded and used in production:"
puts IO.read('config/deploy/production-secrets.json')
ask :answer, "Continue deploying with these config settings? [Y/N]"
fetch(:answer).downcase.strip == 'y'
}
namespace :deploy do
desc "Confirms if the config file should be uploaded"
task :prompt do
@BrettBukowski
BrettBukowski / screenshot.js
Created November 4, 2014 21:42
Screenshot the document or a specific element in it
function urlsToAbsolute(nodeList) {
if (!nodeList.length) {
return [];
}
var attrName = 'href';
if (nodeList[0].__proto__ === HTMLImageElement.prototype ||
nodeList[0].__proto__ === HTMLScriptElement.prototype) {
attrName = 'src';
}
@BrettBukowski
BrettBukowski / index.html
Last active August 29, 2015 14:08
When we can safely access all performance.timing properties
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>When We Can Safely Access all performance.timing properties</title>
<script>
debugger;
</script>
</head>
<body>

Keybase proof

I hereby claim:

  • I am BrettBukowski on github.
  • I am brettbukowski (https://keybase.io/brettbukowski) on keybase.
  • I have a public key whose fingerprint is CA21 2E5B F99F E3C4 A557 F343 01DB 68FB 4498 C400

To claim this, I am signing this object:

@BrettBukowski
BrettBukowski / matrix.swift
Created September 7, 2014 20:18
Matrix rotation in swift
import Foundation
class Matrix {
var n = 0
private var matrix: Array<Array <Int>>
init(n: Int) {
self.n = n
self.matrix = Matrix.create(n)
}
@BrettBukowski
BrettBukowski / Get Current Track.scpt
Created September 7, 2014 14:24
Gets the currently-playing track info
global aname, tname, alname
set musicapp to my appCheck()
try
if musicapp is not false then
if musicapp is "iTunes" then
tell application "iTunes"
set {tname, aname, alname, tduration} to {name, artist, album, duration} of current track
set tpos to player position