Skip to content

Instantly share code, notes, and snippets.

View rsebbe's full-sized avatar

Raphael Sebbe rsebbe

View GitHub Profile
@rsebbe
rsebbe / tensor-api.swift
Created November 19, 2018 14:21
Swift Tensor API Proposal
//
// CeedNumerics
//
// Created by Raphael Sebbe on 16/11/2018.
// Copyright © 2018 Creaceed. All rights reserved.
//
import Foundation
// Slicing
@rsebbe
rsebbe / CRParallaxMotionEffect.h
Created October 2, 2013 09:35
The CRParallaxMotionEffect class allows setting up parallax more easily in iOS 7.
//
// CRParallaxMotionEffect.h
// CeedBase
//
// Created by Raphael Sebbe on 23/07/13.
// BSD License (3-clause). Copyright (c) 2013 Creaceed. All rights reserved.
//
#import <UIKit/UIKit.h>
@rsebbe
rsebbe / set_build_version.sh
Created January 18, 2012 19:38
Setting the CFBundleVersion in a build phase (Xcode >= 4.2). Voluntarily not using the info.plist prefix because of a dependency problem in Xcode build system.
#!/bin/sh
plbuddy="/usr/libexec/PlistBuddy"
toolsdir=$( dirname "${BASH_SOURCE[0]}" )
plist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
vers=`$toolsdir/make_build_version.sh`
vers="$vers"
major=`$plbuddy -c "Print :CFBundleShortVersionString" "$plist"`
@rsebbe
rsebbe / find_build_version.sh
Created January 18, 2012 19:35
Finds the changeset corresponding to the passed build version (CFBundleVersion)
#!/bin/bash
bn=(`echo $1 | tr '.' ' '`)
revn=${bn[0]}
hsh=${bn[1]}
# convert decimal hash to hexadecimal
hsh=`printf '%3.3x' $hsh`
# check all the hashes that start with the prefix
@rsebbe
rsebbe / make_build_version.sh
Created January 18, 2012 19:33
Computes a value for CFBundleVersion based on changeset graph that is monotonically increasing.
#!/bin/bash
hg="/usr/local/bin/hg"
if [ "x$1" != "x" ]
then
cur=`$hg id -ir $1`
else
# get working copy id (partial hash)
cur=`$hg id -i`
@rsebbe
rsebbe / modern_collections.m
Created January 7, 2012 17:14
Modern collections
NSArray *formats = @[@"jpg", @"tiff"];
NSDictionary *options = @{format:@"all", colorSpace:@"RGB"};
@rsebbe
rsebbe / position.js
Created January 5, 2012 21:01
Logo positioning example
function prepareLogoPositioningClasses()
{
//$(".applogo." + creaceed.currentPlatform).removeClass("hidden");
$(".applogo." + creaceed.currentPlatform).addClass("halfshown");
$(".applogoDetector").not("."+creaceed.currentPlatform).addClass("hidden");
$(".applogoDetector."+creaceed.currentPlatform).removeClass("hidden");
if(creaceed.currentProduct)
{