Skip to content

Instantly share code, notes, and snippets.

View mwhuss's full-sized avatar

Marshall Huss mwhuss

View GitHub Profile
@btedev
btedev / timer.rb
Created January 5, 2011 16:19
command-line timer for OS X
#!/usr/bin/env ruby
require 'optparse'
require 'time'
require 'real_growl'
require 'progressbar'
INCREMENTS=100
class TimeFile
@samvermette
samvermette / gist:1691280
Created January 27, 2012 22:27
MapKit callout bubble pop animation
self.view.layer.anchorPoint = CGPointMake(0.50, 1.0);
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
bounceAnimation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.05],
[NSNumber numberWithFloat:1.08],
[NSNumber numberWithFloat:0.92],
[NSNumber numberWithFloat:1.0],
nil];
@grodtron
grodtron / recolor.bash
Created May 13, 2012 22:11
A bash/ImageMagick script to recolor transparent .png files
#!/bin/bash
# A small script to change the color of mono-colored transparent .pngs
#
# Uses ImageMagick to read the most common 100% alpha color and then computes
# scale factors to multiply the whole image by.
#
# Improvements to be made:
# -deal with images containing pure black.
# -make portable between new and old ImageMagick versions
@calebd
calebd / README.md
Created July 19, 2012 14:49
A better build date script for Xcode

A Better Build Date

Showing a build date in an app is pretty easy using __DATE__ and __TIME__ but the format is fixed. This script allows you to control the date and time format and pull the build date from the Info.plist using the CMDBundleBuildTime key.

@mwhuss
mwhuss / gist:3766692
Created September 22, 2012 16:37
Static Sites with Ruby on Heroku
This article includes contributions from [Lee Reilly](http://www.leereilly.net). Lee is a toolsmith and master pintsman hacking on [GitHub Enterprise](https://enterprise.github.com).

Static Sites with Ruby on Heroku

Cedar

Sometimes you just have a static website with one or two pages. Here is a simple way to host your static site and cache it on Heroku using a Rack app.

@mattt
mattt / uiappearance-selector.md
Last active September 24, 2024 12:59
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@calebd
calebd / Readme.markdown
Last active December 20, 2015 05:18
Rdio table view scrolling

Step 1: Configure the table view.

  • Set a view as the table footer
  • Set the background color to clear.

Step 2: Set the default table view values when your view loads. The values and variables seen here are explained below.

- (void)viewDidLoad {
    [super viewDidLoad];
//
// SKNode+TouchPriority.h
// ButtonLab
//
// Created by Fille Åström on 10/20/13.
// Copyright (c) 2013 IMGNRY. All rights reserved.
//
#import <SpriteKit/SpriteKit.h>
@LeSpocky
LeSpocky / rounded_corner.scad
Last active September 24, 2024 18:39
rounded square in openscad
module rounded_square( width, radius_corner ) {
translate( [ radius_corner, radius_corner, 0 ] )
minkowski() {
square( width - 2 * radius_corner );
circle( radius_corner );
}
}
module alternative_square( width, r_c ) {
hull() {
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active November 11, 2024 22:46
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results