Skip to content

Instantly share code, notes, and snippets.

View toto's full-sized avatar

Thomas Kollbach toto

View GitHub Profile
@toto
toto / fb-comments-for-posts.rb
Last active December 30, 2015 18:05
Exports all comments with metadata for a FB post to XLSX.
#!/usr/bin/env ruby
require 'rubygems'
require 'simple_xlsx'
require 'pp'
require 'net/http'
require 'json'
require 'uri'
require 'csv'
@toto
toto / post-checkout
Created December 11, 2014 11:14
Put this in .git/hooks/post-checkout, make it executable with chmod u+x .git/hooks/post-checkout. Now git will complain when you have to do pod install after witching branches. You can also symlink it to .git/hooks/post-merge so it also is run after merge/pull
#!/bin/bash
#
# Let's you know when your pods should be updated right after a git pull or git merge
# Also works for fast-forward pulls.
#
# To enable this hook for your project, save it as .git/hooks/post-checkout
diff "Podfile.lock" "Pods/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
@toto
toto / gist:5bac71f9bbe409b2a352
Created September 10, 2014 07:48
Check iOS System version
NSOperatingSystemVersion ios8_0_1 = (NSOperatingSystemVersion){8, 0, 1};
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:ios8_0_1]) {
// foo
}

Keybase proof

I hereby claim:

  • I am toto on github.
  • I am toto (https://keybase.io/toto) on keybase.
  • I have a public key whose fingerprint is 46E3 01C4 7F40 7696 8050 890A E2C7 AE4D AD30 A810

To claim this, I am signing this object:

@toto
toto / gist:5574964
Created May 14, 2013 10:09
Override preprocessor flags in Pods
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] || %w{ $(inherited) }
s << 'OHATTRIBUTEDLABEL_WARN_ABOUT_KNOWN_ISSUES=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end
end
@toto
toto / gist:4169520
Created November 29, 2012 14:43
VBB API Response Example
<?xml version="1.0" encoding="iso-8859-1"?>
<ResC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://demo.hafas.de/xml/vbb/std/hafasXMLInterface.xsd" ver="1.1" prod="5.31.VBB.4.8.9 [Oct 17 2012]" lang="DE">
<* dir="O">
<ConResCtxt>6t.0297451.1354025783#1</ConResCtxt>
<ConnectionList type="OEV">
<Connection id="C1-0">
<Overview>
<Date>20121126</Date>
<Departure>
<BasicStop type="NORMAL">
@toto
toto / gist:4169511
Created November 29, 2012 14:41
VBB API Demo Request XML
<?xml version="1.0" encoding="iso-8859-1"?>
<ReqC ver="1.1" prod="String" rt="yes" lang="DE" accessId="951a204d5462906e60494ed0a7a79ff5">
<ConReq deliverPolyline="1">
<Start>
<Station externalId="009009203#86" />
<Prod prod="1111111111111111" bike="0" couchette="0" direct="0" sleeper="0" />
</Start>
<Dest>
<Station externalId="009078102#86" />
</Dest>
#!/usr/bin/env ruby
# encoding: utf-8
#
# Usage: ruby csv2json.rb filename.csv
#
require 'csv'
require 'pp'
require 'json'
filename = File.expand_path(ARGV.last)
build/
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
xcuserdata