Skip to content

Instantly share code, notes, and snippets.

View dominik-hadl's full-sized avatar

Dominik Hádl dominik-hadl

  • Prague, Czech Republic
View GitHub Profile
@dominik-hadl
dominik-hadl / GCDSingleton.h
Last active December 16, 2015 23:59 — forked from lukeredpath/ExampleClass.m
GCDSingleton Macro + @ArvinB changes.
/*!
* @function Singleton GCD Macro
*/
#ifndef SINGLETON_GCD
#define SINGLETON_GCD(classname) \
\
+ (classname *)shared##classname { \
\
static dispatch_once_t pred; \
@dominik-hadl
dominik-hadl / JSONPrettyToUgly.py
Last active December 19, 2015 20:08
Automatically minifies all JSON files after building (release or debug).
#!/usr/bin/python
#-------------------------
# Import the dependencies
#-------------------------
import json, sys
#-------------------------
#-------------------------------------
# Get the file names from the argument
@dominik-hadl
dominik-hadl / gdbGetStrippedSymbols.sh
Last active December 20, 2015 06:08
This script automates the setup of gdb on a stripped applicaiton adds symbols. It uses objc-symbols to get the symbols, then SymTabCreator and finally creates a command that is automatically loaded into gdb on start.
#!/bin/sh
# gdbGetStrippedSymbols.sh
# @author Dominik Hadl (@dominikhadl)
# @description This script automates the setup of gdb on a stripped applicaiton adds symbols. It uses objc-symbols to get the symbols,
# then SymTabCreator and finally creates a command that is automatically loaded into gdb on start.
# @license Licensed under WTFPL license (see http://www.wtfpl.net/txt/copying/ for full license).
# @dependencies
# 1. objc-symbols
# 2. SymTabCreator
# 3. gdb (really non-obvious)
#!/bin/sh
# 7zJSON.sh
# @author Dominik Hadl
# @dependencies This script requires that you have p7zip package installed, prefferably through Homebrew.
#
# @description This script will automatically find all .json files in your $BUILT_PRODUCTS_DIR and will compress them to the LZMA (7z) format.
# In the process it will also delete the original .json files - but only in the build folder.
#
# @usage
# 1. Create a new build phase (Run script) in your target in Xcode
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
//
@dominik-hadl
dominik-hadl / finder_expanded_save_dialog.sh
Created November 24, 2013 10:47
I always lose this one, so I'm saving it here for the future. It expands all Finder save windows by default, meaning you don't have to click on that small arrow each time.
defaults write -g NSNavPanelExpandedStateForSaveMode -bool TRUE
@dominik-hadl
dominik-hadl / Create iOS7 Icons From PSD.jsx
Created November 25, 2013 20:15
This is a handy Photoshop script that creates all required and optional iPhone and iPad application icons, including the new dimensions introduced in iOS7. Install instructions are written in the bottom part of the header. Photoshop CS6 or CC is required to run this script. You will have to specify the PSD file containing your icon and then the …
/**
* Photoshop Script to Create iOS 7 Icons from a PSD file
* Version: 1.0.1 (November 2013)
*
* Copyright (c) 2013 Dominik Hadl (@dominikhadl)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@dominik-hadl
dominik-hadl / AddVersionInfoToAppIcon.sh
Created February 8, 2014 12:12
This gist is heavily based on this article (http://www.merowing.info/2013/03/overlaying-application-version-on-top-of-your-icon/), but with some modifications. Specifically, it support the icons stored in .xcassets and also there is now no need to have duplicate files (with _base extension). It just modifies the final copied files if the current…
branch=`git rev-parse --abbrev-ref HEAD`
version=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE}"`
build=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}"`
function processIcon()
{
export PATH=$PATH:/usr/local/bin
target_file="${1}"
if [[ ! -f ${target_file} || -z ${target_file} ]]; then
Apps
----
These are the apps I use most, either for fun or for developing. This list is basically a reference for me, if I reinstall or whatever I do, to know which apps I have used before and what were their names.
* Postbox
* Spotify
* Photoshop CC
* Skype
* Skala Preview
@dominik-hadl
dominik-hadl / Kellys Inconsolata.dvtcolortheme
Created April 19, 2014 07:48
Modified version of Kellys, with Inconsolata-dz as the main font.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>