Skip to content

Instantly share code, notes, and snippets.

View spllr's full-sized avatar

Klaas Speller spllr

View GitHub Profile
@spllr
spllr / companies.kml
Created May 16, 2012 11:15
KML Test File
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Appsterdam Heatmap</name>
<open>1</open>
<description>The Appsterdam Tech Scene</description>
<Style id="mainIcon">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon28.png</href>
@spllr
spllr / writing-ruby-gems-for-rubymotion.md
Created June 19, 2012 13:16
Writing Ruby gems for RubyMotion by Laurent Sansonetti

Writing Ruby gems for RubyMotion

Laurent Sansonetti

RubyMotion projects can be extended through the use of RubyGems, the Ruby de-facto packaging system. This article will cover how to write RubyMotion-specific gems.

This article was inspired by Create gems for RubyMotion, by Francis Chong.

Getting started

@spllr
spllr / bmf_dialog
Created September 27, 2012 10:07
bmf_dialog
#!/usr/bin/env ruby
#
# Usage:
# make_story dialog_text_file.txt [output.plist]
#
# Make sure you install the plist gem:
# [sudo] gem install plist
#
require "parser"
@spllr
spllr / padrino-sprockets.rb
Created October 15, 2012 10:14
Padrino Sprockets Plugin
module SprocketsInitializer
def self.registered(app)
require "sprockets"
app.controllers :assets do
helpers do
def sprockets_env
return @sprockets_environment if @sprockets_environment
@sprockets_environment = Sprockets::Environment.new(Padrino.root)
@sprockets_environment.append_path 'app/assets/javascripts'
@sprockets_environment.append_path 'app/assets/stylesheets'
@spllr
spllr / innoviz_resource.rb
Created October 26, 2012 17:40
InnoViz SF Database mapper
#!/usr/bin/env ruby -wKU
##
# Runtime options
#
require "optparse"
options = { :spec => false }
ARGV.options do |opts|
@spllr
spllr / Appsterdam.geojson
Created August 13, 2013 09:41
The City Of Appsterdam
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spllr
spllr / appsterdam-hq.geojson
Last active December 21, 2015 03:09
Location of Appsterdam HQ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spllr
spllr / String+Hex.swift
Created June 13, 2014 13:57
Convert a hex string to SKColor
import UIKit
import SpriteKit
extension String {
func hexComponents() -> String?[] {
let code = self
let offset = code.hasPrefix("#") ? 1 : 0
let start: String.Index = code.startIndex
return [
@spllr
spllr / cloudkit-request.js
Last active March 29, 2025 05:07
Setting up an authenticated CloudKit server-to-server request
/**
* Demonstrates how to use Apple's CloudKit server-to-server authentication
*
* Create private key with: `openssl ecparam -name prime256v1 -genkey -noout -out eckey.pem`
* Generate the public key to register at the CloudKit dashboard: `openssl ec -in eckey.pem -pubout`
*
* @see https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6
*
* @author @spllr
*/
@spllr
spllr / simple-tic-tac-toe.swift
Last active November 12, 2017 15:18
A simple game of Tic Tac Toe in swift
// Playground by @spllr. Use as you like.
import Foundation
/// A Game of Tic Tac Toe
public struct Game: CustomStringConvertible, Codable
{
/// Game Errors
///
/// - gameFinished: The game has finished and no plays are possible