Skip to content

Instantly share code, notes, and snippets.

View dmiedema's full-sized avatar

Daniel Miedema dmiedema

View GitHub Profile
@dmiedema
dmiedema / Averages
Last active August 29, 2015 14:11
Because I was curious of the performance difference
| DispatchOnce | Static | |
|:--------------:|:-------:|:-------:|
| 107 | 342 | |
| 82 | 408 | |
| 86 | 365 | |
| 88 | 357 | |
| 98 | 375 | |
| 89 | 356 | |
| 90 | 357 | |
| 86 | 351 | |
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
def copyFile(source, destination)
`cp #{source} #{destination}`
end
def resizeCopy(scale, fileName)
widthOutput = `sips -g pixelWidth #{fileName}`
@dmiedema
dmiedema / DMMTestUtilities.h
Last active August 29, 2015 14:05
Create in memory NSManagedObjectContext for testing classes that use CoreData.
//
// DMMTestUtilities.h
// dmiedema
//
// Created by Daniel on 8/25/14.
// Copyright (c) 2014 Daniel Miedema. All rights reserved.
//
#import <Foundation/Foundation.h>
Dear <% Senator's Name %>,
With the recent happenings in Ferguson Missouri I’d like to know what kinds of actions you plan to take to prevent further incidents of an entire city being turned into a police state.
Watching news stories and seeing photos of the police in what looks like gear to be worn on the front lines of a war to a protest makes me seriously question the what is happening in this country. What are you doing as an elected official to change this?
Between the NSA incredible overreach and violation of American citizens privacy, net neutrality, and what appears to be a police state having formed, it appears as though I am not in the land of the free anymore and I feel it is your duty as a representative in, what is supposed to be a democracy, to fix it.
Thanks you,
<% name %>

Keybase proof

I hereby claim:

  • I am dmiedema on github.
  • I am dmiedema (https://keybase.io/dmiedema) on keybase.
  • I have a public key whose fingerprint is FCA0 F9CA CCC4 A8B5 1A98 20FA 91DB 669C AA5D B612

To claim this, I am signing this object:

@dmiedema
dmiedema / lazyDispatch.m
Created April 13, 2014 18:38
helper method to dispatch a block on the main queue. Only exists because I'm super lazy and hate typing.
/**
* Helper wraper around dispatching a block on the main thread
* Utilizes GCD's dispatch_async(dispatch_get_main_queue(), ^{});
*
* @param Block to execute on the main thread asynchronously
*/
void dispatch_on_main_queue(dispatch_block_t block) {
dispatch_async(dispatch_get_main_queue(), block);
}
@dmiedema
dmiedema / pod-use-check.rb
Created March 6, 2014 17:44
Check for which cocoapods are used or not used in your project. Super rough and not 100% accurate right now
#!/usr/bin/env ruby
#
#
#
$pods = Array.new
File.open("Podfile", "r") do |infile|
while (line = infile.gets)
pod = line.split(',')[0]
if !pod["pod"].nil? && pod[0] != '#'

rage-quit plugin for oh-my-zsh

based on rage-quit support for bash

HOW TO INSTALL

Put the files below inside ~/.oh-my-zsh/custom/plugins/fuck

Also chmod a+x the flip command.

@dmiedema
dmiedema / vimrc.local
Created January 23, 2014 18:10
vimrc.local
" set word wrap
set wrap
" set indent size to 2
set shiftwidth=2
set tabstop=2
set softtabstop=2
" set gg=G settings
set expandtab " use spaces instead of tabs
set ts=2
@dmiedema
dmiedema / XcodeBuildUpdate.sh
Last active January 3, 2016 05:09
Update Xcode projects CFBuildVersion in the Info.plist based on either the last git commits sha-hash (first 6 characters) or the count of the number of git commits if on master or set production branch
####
# XcodeBuildUpdate
# Created by Daniel Miedema
# MIT License
####
# Variables -- change as needed
PROD_BRANCH="master"
BUILD="0"