Skip to content

Instantly share code, notes, and snippets.

Stephan Burlot sburlot

Block or report user

Report or block sburlot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sburlot
sburlot / unban.pl
Created Mar 7, 2018
remove an iptable rule, passing an IP address to look for
View unban.pl
#!/usr/bin/perl
## unban an IP using iptables
## script will display the iptable command to run, it will not delete the rule (if found)
## Usage: ./unban.pl -ip=123.123.123.123
use Getopt::Long;
@LINES = `iptables -L -n`;
@sburlot
sburlot / check_arq_release_notes.pl
Created May 17, 2016
Checks if the Arq Backup release note page has changed and sends a notification. Run every hour via cron.
View check_arq_release_notes.pl
#!/usr/bin/perl
require WebService::Prowl;
my $oldvalue = "";
my $md5 = "";
$result = `curl -s "https://www.arqbackup.com/download/arq5_release_notes.html" | md5sum`;
($md5, $ignore) = split(/\s/, $result);
@sburlot
sburlot / gist:9856a15119985a6f1a87
Created Mar 22, 2015
Detect Touch outside a view
View gist:9856a15119985a6f1a87
@property (nonatomic, strong) UITapGestureRecognizer *gesture;
//==========================================================================================
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
self.gesture.numberOfTapsRequired = 1;
self.gesture.numberOfTouchesRequired = 1;
self.gesture.delegate = self;
View gist:cdfcbc6c64d2f0a8ac3c
STHTTPRequest* r = [STHTTPRequest requestWithURLString:POST_CONTRACT_URL];
NSDictionary *dataToEncode = @{@"key0": @"object",
// other data...
@"key1": @"object"};
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dataToEncode
options:NSJSONWritingPrettyPrinted
error:&writeError];
@sburlot
sburlot / xc_ramdisk.sh
Created Mar 8, 2014
Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
View xc_ramdisk.sh
#!/bin/bash
# Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
# xc_ramdisk.sh
# - creates a ramdisk, set Xcode DerivedData to this disk and start Xcode.
# - umount a ramdisk, set Xcode DerivedData to default
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch
#
# based on Alex Shevchenko xcode_ramdisk.sh script (https://gist.github.com/skeeet/2367298)
# based on Diego Freniche xc-launch.sh script (https://github.com/dfreniche/xc-launch)
@sburlot
sburlot / objcio2instapaper.rb
Created Oct 9, 2013
This ruby script fetches all articles from an issue of the excellent objc.io periodical and send them to Instapaper. This script should be automated so it runs automatically when a new issue is available. Perhaps parsing the RSS?
View objcio2instapaper.rb
#!/usr/local/bin/ruby
# fetches the content of an objc.io issue and send it to Instapaper
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch
# First version Oct 10, 2013
# ruby was installed via homebrew, so the path to ruby is /usr/local/bin
# you may need to change it to the actual path of your ruby installation.
require 'nokogiri'
require 'open-uri'
@sburlot
sburlot / NXC Configuration.plist
Created Aug 6, 2013
BBEdit/TextWrangler codeless language module for NXC source files. NXC is Not eXactly C, a programming language for the Lego Mindstorms NXT 2.0
View NXC Configuration.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
BBEdit/TextWrangler codeless language module for NXC source files.
NXC is Not eXactly C, a programming language for the Lego Mindstorms NXT 2.0
Stephan Burlot, Coriolis Technologies
http://coriolis.ch
@sburlot
sburlot / check_status.rb
Last active Dec 20, 2015
Monitor the Apple Status page and send a notification when a new service is enabled. See: http://blog.coriolis.ch/check-if-apple-services-are-online/
View check_status.rb
#!/usr/bin/ruby
# monitor the Apple Status page and send a notification when a new service is enabled
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'yaml'
require 'prowl'
@sburlot
sburlot / .lldbinit
Created Jun 30, 2013
Macros for lldb
View .lldbinit
# from https://gist.github.com/mike3k/4513568
# rd: print a recursive description of views
command regex rd 's/^[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/'
# prect: print the properties of a rect
command regex prect 's/(.+)/print (CGRect)%1/'
@sburlot
sburlot / gist:5328122
Created Apr 6, 2013
Add a Run Script phase to your Xcode project and add this script to detect if you use autolayout in your 5.x target
View gist:5328122
#!/usr/bin/perl
#
# Check if we're running for 5.1 deployment and any .xib view has autolayout on.
#
use File::Find qw(find);
my $deployment = $ENV{'IPHONEOS_DEPLOYMENT_TARGET'};
my $project_dir = $ENV{'PROJECT_DIR'};
print "Deploy to $deployment\n";
You can’t perform that action at this time.