Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/bin/bash | |
# | |
#################################### | |
# iTunes Command Line Control v1.0 | |
# written by David Schlosnagle | |
# created 2001.11.08 | |
# edit 2010.06.01 rahul kumar | |
#################################### | |
showHelp () { |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# Xcode 4.3.3 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix | |
# Xcode 4.3.2 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix |
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"
@implementation CIContext (IntermediateImage) | |
- (CIImage *)rsq_renderToIntermediateImage:(CIImage *)image { | |
CIImage *intermediateImage = nil; | |
CGSize size = image.extent.size; | |
CVPixelBufferRef pixelBuffer = NULL; | |
CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, | |
size.width, | |
size.height, | |
kCVPixelFormatType_32ARGB, |
//////////////////////////////////////////////// | |
// | |
// Swift and Objective-C Class Parsing | |
// | |
//////////////////////////////////////////////// | |
import Foundation | |
// Class parsing |
This is a simple way to spot check that the modified image in your git index is the image you actually want without having to leave the command line.
Example: http://i.imgur.com/RUenUcM.png
img-ascii-diff
somewhere (e.g. ~/bin/img-ascii-diff
).attributes
in ~/.config/git/attributes
.~/.gitconfig
and add the lines below, pointing to wherever you put img-ascii-diff
.// | |
// loveWins(): a simple function that accepts a UIImage and | |
// returns the same image blended with the rainbow flag | |
// of the LGBT pride movement. | |
// | |
// This is released for pedagogical reasons (I've tried to make | |
// the code as easy to follow as possible!) but you're welcome | |
// to use it for any purpose – consider the code yours. | |
// | |
// If you're using Xcode 7 / Swift 2, you need to make a tiny |
import UIKit | |
import TVMLKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate, TVApplicationControllerDelegate { | |
var window: UIWindow? | |
var appController: TVApplicationController? | |
Greetings and salutations, NSHipsters!
As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.
Submit your favorite piece of Swift or @objc
trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!
If you need inspiration, try [the list from last year][2015], or [from the year before][2014], or [from the year before that][2013].