Skip to content

Instantly share code, notes, and snippets.

View bananita's full-sized avatar

Michał Banasiak bananita

  • so many apps
  • Poland
View GitHub Profile
@bananita
bananita / script.sh
Created November 4, 2015 13:54
bumbimp podspec version
#!/bin/bash
version=`grep -E "\.version\s*=\s*[\"']*[\"']" Registration.podspec | awk -v FS="('|')" '{print $2}'`
version=`echo $version | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'`
echo $version
@bananita
bananita / gist:0b5c79f8de16219da000
Created October 12, 2015 14:05
Check number of lines in git
#!/bin/bash
IFS=$'\n'
git log --format='%aN' | sort -u | while read -r user ; do
echo $user
git log --author=$user --pretty=tformat: --numstat -- . ":(exclude)*.pbxproj" ":(exclude)*.xcworkspace" ":(exclude)*.storyboard" ":(exclude)*.xib" ":(exclude)*Pods" ":(exclude)*Podfile.lock"| awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
done
@bananita
bananita / gist:31ab0aaa3d4e17f3633e
Last active August 29, 2015 14:10
computing number of code lines
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.h" -or -name "*.cpp" ")" -print0 | xargs -0 wc -l

Object-oriented languages

Assignment

In this assignment you should design and implement a minimal object-based programming language with delegation. It must be complete enough to

  • read instructions of arbitrary form (any human-readable format)
@bananita
bananita / gist:3415194c2610e49a5bf9
Created February 26, 2014 13:41
date as build number
build_number=`date +%d.%m.%Y`
for x in `find ${SRCROOT}/Resources/Applications -name "Info.plist" -print`; do
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${build_number}" "$x"
done
(global-hl-line-mode 1)
(set-face-background 'hl-line "#3e4446")
(set-face-foreground 'highlight nil)
(transient-mark-mode 1)
(set-face-background 'region "white")
(set-face-foreground 'region "blue")
(set-face-background 'highlight "white")
(set-face-foreground 'highlight "blue")
(setq make-backup-files nil)
@implementation ChildManagedObjectContext
- (BOOL)save:(NSError *__autoreleasing *)error
{
NSError* superError;
BOOL superResult = [super save:&superError];
if (!superResult) {
*error = superError;
return NO;
@bananita
bananita / gist:8652005
Created January 27, 2014 16:36
gist submodules refreshing
git pull && git submodule init && git submodule update && git submodule status
@bananita
bananita / How to convert *app to *ipa
Created December 19, 2013 13:23
How to convert *app to *ipa
1. Create a folder called Payload
2. Place the .app folder inside of that
3. Zip up the Payload folder using normal compression
4. Then rename the file with a .ipa extension
render text: Kramdown::Document.new(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s).to_html
GitHub::Markdown.render_gfm(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s)
CodeRay.scan(GitHub::Markdown.render_gfm(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s), :objc).div(:line_numbers => :table)