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 / 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
diff --git a/Classes/SMEUser.m b/Classes/SMEUser.m
index c9c89f2..f02d339 100644
--- a/Classes/SMEUser.m
+++ b/Classes/SMEUser.m
@@ -569,10 +569,10 @@
- (NSURL *)editingController:(TKModelEditingController *)controller confirmationContentURLForKey:(NSString *)key;
{
if ([key isEqual:@"hasAcceptedPrivacyStatement"]) {
- return [NSURL URLWithString:@"https://www.samedi.de/de/terms_of_service/patient?layout=iphone"];
+ return [NSURL URLWithString:@"https://www.samedi.de/de/privacy_statement/patient?layout=iphone"];
@toto
toto / gist:1892885
Created February 23, 2012 13:44
Pass redirect URLs from an embedded webView to the shared account store
- (void)awakeFromNib;
{
[super awakeFromNib];
_webView.policyDelegate = self; // you can also do this in the XIB and save you this method
}
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener;
{
NSURL *redirectURL = [NSURL URLWithString:VCOAuthRedirectURLString];
if ([request.URL.scheme isEqual:redirectURL.scheme] &&
@toto
toto / gist:1768284
Created February 8, 2012 11:24
A simple webserver that makes the current directory available via HTTP
#!/usr/bin/env ruby
require "webrick"
port = ARGV.count > 0 ? ARGV.last.to_i : 8080
STDERR.puts "Starting WEBRick server on http://localhost:#{port}"
server = WEBrick::HTTPServer.new :Port => port
server.mount "/", WEBrick::HTTPServlet::FileHandler, './'
trap('INT') do
STDERR.puts "Stopping WEBRick"
server.stop
end