Skip to content

Instantly share code, notes, and snippets.

View zbyhoo's full-sized avatar

zbyhoo zbyhoo

  • Gamesture
  • Poland, Katowice
View GitHub Profile
@zbyhoo
zbyhoo / install.cmd
Last active April 16, 2026 10:07
Gamesture — Codex CLI Setup (Windows)
@echo off
chcp 65001 >nul 2>&1
setlocal EnableDelayedExpansion
REM ---------------------------------------------------------------------------
REM Gamesture -- Codex CLI Setup (Windows)
REM
REM Instaluje wszystko co potrzebne:
REM 1. Git for Windows
REM 2. Codex CLI
@zbyhoo
zbyhoo / install.sh
Created March 27, 2026 16:02
Gamesture — Codex CLI Setup (macOS / Linux)
#!/usr/bin/env bash
# Wymuszaj bash nawet gdy uruchomiony przez zsh (np. zsh /tmp/gs-codex-install.sh)
if [ -z "${BASH_VERSION:-}" ]; then
exec bash "$0" "$@"
fi
# Cały skrypt w subshell — exit zamyka tylko subshell, nigdy terminal użytkownika
(
set -euo pipefail
_exit() { exit "$1"; }
@zbyhoo
zbyhoo / build_tesseract.sh
Created March 19, 2012 20:50
Downloads and compiles Tesseract OCR library for iOS
#!/bin/sh
# build.sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.68"
TESSERACT_LIB="`pwd`/tesseract-3.01"
IOS_BASE_SDK="5.1"
IOS_DEPLOY_TGT="4.3"
@zbyhoo
zbyhoo / gist:1450703
Created December 9, 2011 08:11
print sorted by size list of all files/folders in current directory in human readable form
du -s * | sort -nr | cut -f2- | xargs -I {} du -hs {}
@zbyhoo
zbyhoo / gist:1372918
Created November 17, 2011 11:06
Removing all files that will not be source controlled from Library dir of Unity3D project
rm $(ls * | grep -v 'EditorBuildSettings.asset\|InputManager.asset\|ProjectSettings.asset\|QualitySettings.asset\|TagManager.asset\|TimeManager.asset\|AudioManager.asset\|DynamicsManager.asset\|NetworkManager.asset')
@zbyhoo
zbyhoo / gist:1266907
Created October 6, 2011 09:06
Pretty nice way to find UIViewController of UIView using category
@interface UIView (FindUIViewController)
- (UIViewController *) firstAvailableUIViewController;
- (id) traverseResponderChainForUIViewController;
@end
@implementation UIView (FindUIViewController)
- (UIViewController *) firstAvailableUIViewController
@zbyhoo
zbyhoo / gist:1188407
Created September 2, 2011 11:24
git: printing pretty one-line commits info with colors
git log --pretty=format:'%C(yellow)%h%Cred%d%Creset - %C(cyan)%an %Creset: %s %Cgreen(%cr)'
@zbyhoo
zbyhoo / gist:1077733
Created July 12, 2011 10:17
XCode "Run Script" phase for printing TODOs and FIXMEs as warnings
KEYWORDS="TODO.*:|FIXME.*:|\?\?\?.*:|\!\!\!.*:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.mm" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
@zbyhoo
zbyhoo / solve_pbxproj_merge_conflict.sh
Created May 5, 2011 09:00
Solving pbxproj files git merge conflicts when two users add files at the same time.
#!/bin/sh
projectfile=`find -d . -name 'project.pbxproj'`
projectdir=`echo *.xcodeproj`
projectfile="${projectdir}/project.pbxproj"
tempfile="${projectdir}/project.pbxproj.out"
savefile="${projectdir}/project.pbxproj.mergesave"
cat $projectfile | grep -v "<<<<<<< HEAD" | grep -v "=======" | grep -v "^>>>>>>> " > $tempfile
cp $projectfile $savefile
@zbyhoo
zbyhoo / count_gcc_warnings.sh
Created April 27, 2011 12:09
Sorts and counts all warnings from gcc compilation output
#!/bin/bash
if [ "$#" != "1" ]
then
echo wrong number of arguments
echo Usage: $0 \<filename\>
echo filename - file with build output
exit 1
else
cat $1 | grep "warning:" | sort | uniq -c | sort -nr | awk '{print $0}{total+=1}END{print "Total number of warnings:\n"total}'