Skip to content

Instantly share code, notes, and snippets.

View webdevotion's full-sized avatar

Bram Plessers webdevotion

View GitHub Profile
@webdevotion
webdevotion / button.mm
Last active April 8, 2018 01:56
rotation
[self.loadDataButton setBackgroundImage:[[UIImage imageNamed:@"big-button"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.f, 4.f, 4.f, 4.f)]
forState:UIControlStateNormal];
[self.loadDataButton setBackgroundImage:[[UIImage imageNamed:@"big-button-highlighted"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.f, 4.f, 4.f, 4.f)]
forState:UIControlStateHighlighted];
[self.loadDataButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[self.loadDataButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
@webdevotion
webdevotion / vimeo.rake
Created May 23, 2013 12:39
The Vimeo API currently does not allow you to fetch the direct links for private Pro videos through their API. This `rake` task fetches the HTTP Live Streaming link so you can you `MPMoviePlayerController` in you iOS applications in stead of a webview.
namespace :vimeo do
desc "Get Vimeo HTTP Live Streaming link for private Pro videos"
task :direct => :environment do |t,args|
your_video_id = "66666666" # change this to your video id
loginURL = "https://vimeo.com/log_in"
videoFormAction = "/#{your_video_id}/settings/file"
@webdevotion
webdevotion / store.m
Created November 28, 2012 12:13
Sharedstore
+ (WDPProductStore *)sharedStore
{
static dispatch_once_t once;
static WDPProductStore *__sharedStore;
dispatch_once(&once, ^ { __sharedStore = [[WDPProductStore alloc] init]; });
return __sharedStore;
}
@webdevotion
webdevotion / .bash_profile
Last active December 21, 2020 10:17
Fancy bash shell
# READ MORE HERE: http://www.webdevotion.be/blog/2012/06/06/terminal-git-branch-status-colored-icons
# ==============================================================================
# FANCY GIT STATUS ICONS
# ==============================================================================
# SOME VARIABLES in capitals
# no whitespace between variable names and = sign!
COLOR_RESET="\e[00m"
COLOR_GREEN="\e[1;32m"
COLOR_RED="\e[00;31m"
@webdevotion
webdevotion / NFRSSChannel.m
Created March 11, 2012 06:34
A better way to trim titles and post link
-(void)trimItemTitles
{
for(NFRSSItem *rssItem in [self items])
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CHOP CHOP: let's get what we need from the raw posttitle
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// we want 3 pieces of info: category, posttitle and possible "reply by" or "author"
// split the string up on " :: " - array length might be 2 or 3, depending on presence of " :: Reply by"
@webdevotion
webdevotion / BNRDocument.m
Created March 4, 2012 14:51
error handling
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
todoItems = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainers format:NULL error:outError];
BOOL errorFound = todoItems == nil;
if (errorFound)
{
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:@"Custom Error Description" forKey:NSLocalizedDescriptionKey];
Feature: Creating Users
In order to add new users to the system
As an admin
I want to be able to add them through the backend
Background: # features/creating_users.feature:6
Given there are the following users: # features/step_definitions/user_steps.rb:1
| email | password | admin |
| admin@ticketee.com | password | true |
And I am signed in as them # features/step_definitions/user_steps.rb:10
@webdevotion
webdevotion / build.properties
Created July 12, 2011 10:02
Flash Builder Premium: release build, copy release to web folder, git add / commit / push
RAILS_APP=../../../my_rails_app/
@webdevotion
webdevotion / config-compass.rb
Created May 17, 2011 06:48
heroku compass config
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
project_path = Compass::AppIntegration::Rails.root
# Set this to the root of your project when deployed:
http_path = "/"
environment = Compass::AppIntegration::Rails.env
if environment == 'production'
css_dir = "tmp/stylesheets"
@webdevotion
webdevotion / build.xml
Created February 16, 2011 12:49
contents of my build.xml
<?xml version="1.0"?>
<project default="release">
<target name="release">
<echo>
Building release build
</echo>
<fb.exportReleaseBuild project="Amazing Project" />
</target>