Skip to content

Instantly share code, notes, and snippets.

View boyvanamstel's full-sized avatar
👋
Hi there

Boy van Amstel boyvanamstel

👋
Hi there
View GitHub Profile
@boyvanamstel
boyvanamstel / youtube.lua
Created September 15, 2012 21:46
Fixed VLC youtube.lua parser
-- Apparently YouTube changed some stuff. This makes VLC play YouTube clips again.
-- Replace youtube.lua in /Applications/VLC.app/Contents/MacOS/share/playlist/youtube.lua.
-- Ticket @ VLC: https://trac.videolan.org/vlc/ticket/7471
--[[
$Id$
Copyright © 2007-2011 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@boyvanamstel
boyvanamstel / gist:3011433
Created June 28, 2012 13:38
Automatically increase build number in Xcode4 project
# Via: http://blog.suda.pl/2012/01/auto-increment-build-number-in-xcode-4-2-fixed/
# Just add “Run Script” build phase with this script (remember to move it before
# “Copy Bundle Resources” phase) and set your CFBundleVersion to an integer.
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist)
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist
@boyvanamstel
boyvanamstel / gist:2954676
Created June 19, 2012 15:04
Firefox Extension: Add a button to the navigation toolbar
// Source: http://stackoverflow.com/questions/5572632/firefox-how-can-i-add-modify-toolbars-using-the-add-on-sdk-jetpack
// Only works on first window opened..
var data = require("self").data;
var {Cc, Ci} = require("chrome");
var mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator);
exports.main = function(options, callbacks) {
addToolbarButton();
// other stuff
@boyvanamstel
boyvanamstel / gist:2936138
Created June 15, 2012 12:01
Minimal HTML5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<!-- page content -->
@boyvanamstel
boyvanamstel / gist:2932429
Created June 14, 2012 19:34
Change app language
$ /Applications/Porthole.app/Contents/MacOS/Porthole -AppleLanguages "(German)"
@boyvanamstel
boyvanamstel / gist:2919779
Created June 12, 2012 19:58
Enable/Disable 'Gatekeeper' in Mac OS X Lion for testing purposes
$ sudo spctl --master-enable
$ sudo spctl --master-disable
# Read more: http://forums.appleinsider.com/t/143736/gatekeeper-is-hidden-in-os-x-10-7-3-lion-developers-can-preview-it-now
@boyvanamstel
boyvanamstel / gist:2919778
Created June 12, 2012 19:58
Enable/Disable 'Gatekeeper' in Mac OS X Lion for testing purposes
$ sudo spctl --master-enable
$ sudo spctl --master-disable
# Read more: http://forums.appleinsider.com/t/143736/gatekeeper-is-hidden-in-os-x-10-7-3-lion-developers-can-preview-it-now
@boyvanamstel
boyvanamstel / gist:2919615
Created June 12, 2012 19:29
Get .app certificate details
$ codesign -d -vvv [Application].app
# Or use: http://itunes.apple.com/us/app/rb-app-checker-lite/id519421117?mt=12
@boyvanamstel
boyvanamstel / dcxibupdater.sh
Created May 24, 2012 15:44
dcxibupdater - Updates all your localized Xibs in your Xcode project using Git and ibtool
#!/bin/sh
#
# dcxibupdater - Danger Cove Xib Updater
#
# Updates all your localized Xibs in your Xcode project using Git and ibtool.
#
# Prerequisites and setup:
# - Xcode project stored in Git
# - Localized .xib files
# - IMPORTANT: Add *_prev.xib to your .gitignore
@boyvanamstel
boyvanamstel / PreferencesManager.c
Created November 30, 2011 14:46
Objective-C class to loop through startup items with Automatic Reference Counting (ARC) enabled
// Based on http://www.bdunagan.com/2010/09/25/cocoa-tip-enabling-launch-on-startup/
// Almost automatic convert to ARC, might need tweaking.
#import "PreferencesManager.h"
@implementation PreferencesManager
// MIT license
- (BOOL)isLaunchAtStartup {
// See if the app is currently in LoginItems.