Skip to content

Instantly share code, notes, and snippets.

Simon Schoeters cimm

Block or report user

Report or block cimm

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
@cimm
cimm / gist:250423
Created Dec 6, 2009
Creates a github like punch card graphic in SVG
View gist:250423
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<!-- Set the light gray background -->
<rect width="740px" height="330px" style="fill:#efefef"/>
<!-- Set the x axis labels and gridlines -->
<text x="10px" y="30px" font-family="Verdana, sans-serif" font-size="11px" fill="#333">mon</text>
<text x="10px" y="70px" font-family="Verdana, sans-serif" font-size="11px" fill="#333">tue</text>
@cimm
cimm / NEMA2KML.scpt
Created Jan 16, 2010
This AppleScript converts a NMEA input file and converts all real coordinates to Google placemarks in a KML file.
View NEMA2KML.scpt
property script_name : "NMEA2KML"
property script_version : "0.3"
property script_description : "This script converts a NMEA input file and converts all real coordinates to Google placemarks in a KML file."
property script_copyright : "Creative Commons Attribution 3.0 License"
property script_author : "Simon Schoeters"
property script_website : "http://www.suffix.be/"
-- Get the file and its path
set filePath to (choose file with prompt "Select a NMEA file:") as Unicode text
set filePath to replace_chars(filePath, ":", "/")
@cimm
cimm / RepairiPhotoDates.scpt
Created Jan 16, 2010
AppleScript that gets the selected photos in iPhoto, extracts the iPhoto date and adds it in the photo EXIF data.
View RepairiPhotoDates.scpt
property script_name : "RepairiPhotoDates"
property script_version : "0.2"
property script_description : "Gets the selected photos in iPhoto, extracts the iPhoto date and adds it in the photo EXIF data."
property script_copyright : "Creative Commons Attribution 3.0 License"
property script_author : "Simon Schoeters"
property script_website : "http://www.suffix.be/"
-- Open iPhoto, select the photos you need and run the script, it will replace the date in the EXIF headers with the data iPhoto shows. You'll need ExifTool by Phil Harvey (www.sno.phy.queensu.ca/~phil/exiftool/) installed to make this work.
tell application "iPhoto"
@cimm
cimm / freemarker.syn
Created Jan 16, 2010
TextPad keyword syntax file for Freemarker.
View freemarker.syn
; TextPad keyword syntax file for Freemarker
; Contributed by Simon Schoeters, version 0.2
HTML=1
[Syntax]
Namespace1 = 2
IgnoreCase = Yes
KeyWordLength =
BracketChars = {}[]()
@cimm
cimm / train.rb
Last active Sep 4, 2015
Gets the NMBS/SNCB trains leaving from a given station in Belgium.
View train.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'cgi'
require 'open-uri'
require 'hpricot'
current_time = Time.now.strftime("%H:%M")
url = ""
user_agent = "Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.253.0 Safari/532.5"
@cimm
cimm / gist:463765
Created Jul 4, 2010
Creates an Heroku bundle and downloads the result, removing the old local backup if needed.
View gist:463765
#!/usr/bin/env ruby
app = "your-heroku-app"
STDOUT.sync = true
start_time = Time.now
# Prepare old backup for rotate if needed
if File.exist?("#{app}.tar.gz.backup")
puts "\e[31mThe previous backup did not end well, check manually.\e[0m"
View gpx2image
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'gnuplot'
if ARGV[0]
source = ARGV[0]
else
puts "usage: ./gpx2image source_file"
exit(0)
@cimm
cimm / gRaphael.js
Created Jul 28, 2010
Easiest way to draw a line graph with gRaphael
View gRaphael.js
// Initialize the Raphael object
var r = Raphael("holder");
// Assign the values for the X axis
var x = [1, 2, 3, 4];
// Assign the values for the Y axis
var y = [1, 2, 1, 3];
// Draw a line chart (startX, startY, width, height, valuesX, valuesY)
r.g.linechart(0, 0, 300, 220, x, y);
@cimm
cimm / gist:736953
Created Dec 10, 2010
Creates an Heroku dump and downloads the result, removing the old local backup if needed.
View gist:736953
#!/usr/bin/env ruby
app = "your-heroku-app"
STDOUT.sync = true
start_time = Time.now
# Fail if the previous dump did not end well
if File.exist?("#{app}.dump.backup")
puts "\e[31mThe previous dump did not end well, check manually.\e[0m"
@cimm
cimm / gist:1359553
Created Nov 11, 2011
Imports a folder in iPhoto
View gist:1359553
-- debugging
on log_event(themessage)
set theLine to (do shell script "date +'%Y-%m-%d %H:%M:%S'" as string) & " " & themessage
do shell script "echo " & theLine & " >> ~/Library/Logs/AppleScript-events.log"
end log_event
-- Extract the album name from the session file
on extractAlbumName(sessionContents)
set albumName to ""
set allLines to every paragraph of sessionContents
You can’t perform that action at this time.