Skip to content

Instantly share code, notes, and snippets.

Pétur Ingi Egilsson peturingi

Block or report user

Report or block peturingi

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
@peturingi
peturingi / gist:901315c8af6047716022493c963bb7ad
Created Dec 5, 2019
Checks if two EMF objects are structurally equivalent.
View gist:901315c8af6047716022493c963bb7ad
/**
* Checks if two objects are structurally equivalent.
*
* @param object1
* @param object2
* @return
*/
static <T extends Notifier> boolean areStructurallyEquivalent(final T object1, final T object2) {
final EMFCompare comparator = EMFCompare.builder().build();
final IComparisonScope scope = new DefaultComparisonScope(object1, object2, null);
@peturingi
peturingi / Program.cs
Created Jul 25, 2018
An example of how to use InteractionType, correctResponsePattern and choices with my fork of TinCan
View Program.cs
using System;
using System.Collections.Generic;
using TinCan;
namespace ConsoleApp1
{
class Program
{
private const string lang = "en-US";
@peturingi
peturingi / macports-updates-terminal-notifier.sh
Last active Nov 22, 2017
Notify of MacPort updates via Notifications on macOS.
View macports-updates-terminal-notifier.sh
#!/bin/bash
#
# Notify of MacPorts updates via notifications on macOS.
#
# Author: Pétur Ingi Egilsson <petur@ingi.dk>
# Requires: MacPorts and terminal-notifier (install terminal-notifier from MacPorts).
PORT_EXEC='/opt/local/bin/port'
TERMINAL_NOTIFIER='/opt/local/bin/terminal-notifier'
View UIView+ColorAtPoint.h
/*
Copyright (c) 2014, EP Software, Pétur Ingi Egilsson <petur@epsoftware.dk>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
View gist:10563427
#import "SQLiteStore.h"
@implementation SQLiteStore
- (id)init {
self = [super init];
if (self) {
[self establishDatabaseConnection];
}
return self;
View gist:10563385
#import "CalendarCollectionViewLayout.h"
#define CELL_KEY @"ImageCell"
static const NSInteger INSET_TOP = 2;
static const NSInteger INSET_LEFT = 2;
static const NSInteger INSET_RIGHT = 2;
static const NSInteger INSET_BOTTOM = 2;
@interface CalendarCollectionViewLayout ()
View CountrySelectorViewController.h
#import <UIKit/UIKit.h>
#import "CountrySelectorDelegate.h"
@interface CountrySelectorViewController : UITableViewController <UISearchDisplayDelegate,UISearchDisplayDelegate> {
NSArray *_countries;
NSArray *_searchResults;
/**
* Indicates whether the TableView is currently being searched.
* @return YES the tableview is being searched.
* @return NO the tableview is not being searched.
You can’t perform that action at this time.