Skip to content

Instantly share code, notes, and snippets.

View qnoid's full-sized avatar
💭
I have been raised by women. My single mother, my grandma, my godmother.

Markos Zoulias Charatzas qnoid

💭
I have been raised by women. My single mother, my grandma, my godmother.
View GitHub Profile
@interface Foo()
@property(nonatomic, strong) dispatch_group_t lock;
@end
@implementation Foo
-(id)init
{
self = [super init];
@interface Item : NSObject
{
@private
UIImage *image;
NSString *value;
NSString *when;
}
@property(nonatomic, retain) UIImage *image;
@property(nonatomic, retain) NSString *value;
@qnoid
qnoid / hashtable
Created April 7, 2011 15:33
graphical representation of a hashtable
9
6 7
3 4 5
[0, 1, 2] //buckets
^ ^ ^
0 1 2 //bucket index
|---3---| //hashtable length
@qnoid
qnoid / HttpsURLConnectionFactory.java
Created September 10, 2011 09:48
Provides access to secure url connections; given certificate as specified by java.security.cert.CertificateFactory#generateCertificate
/*
* This file is under the license Attribution-ShareAlike 3.0 Unported
* (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/
*
* You are free:
* to Share - to copy, distribute and transmit the work
* to Remix - to adapt the work
*
* Under the following conditions:
*
@qnoid
qnoid / changelog.sh
Created August 1, 2012 16:11
Generate sane changelog between revisions
# show the log between two revisions | sort unique to remove all but one blank and '---' lines | awk to NOT match any lines starting with rXXXXX denoting revision information
#$1, $2 range revision arguments
#!/usr/bin/env bash
svn log -r $1:$2 | sort -u | awk '!/(^r[0-9]*)/'
@qnoid
qnoid / User Identity.markdown
Created November 10, 2012 00:49
A post about user identity that is thought provoking on user authorisation and security, or just utter bullshit.

User identity

Disclaimer: I am no security expert.

Use case

Provide a way for a user to identify himself before remotely accessing a multi-user software that requires to associate the user with her data.

Introduction

@qnoid
qnoid / gist:4052818
Created November 10, 2012 22:45
Mockups on user identity

Mockups on user identity

[A video of an iOS implementation is available][8].

User identity

[The idea of a user identity][7] is a simple one with a goal to eliminate the requirement of a user entering a password. Any other requirement, including storing, transmitting and hashing should stay the same.

Introduction

As soon as a software is installed that supports user identities, a user is presented with a screen to identify.

@qnoid
qnoid / gist:4315284
Created December 17, 2012 02:04
"Those who cannot remember the past are condemned to repeat it." - George Santayana

Last Thursday it was the 3rd annual startups Christmas party at TechCube. Just one day prior, a cofounder from a Scottish startup had walked away after being offered to sign an investment deal.

Negotiations had been going on for months. No one can last that long, unless has substantial savings, takes a loan, his partner/family supports him or has a part time job to cover his living expenses.

It wasn't an easy decision. When you sacrifise that much for that long, it's hard letting go. You have doubts. Doubts about the choice you are about to make. You feel its weight on your shoulders; growing heavy. Accumulated by the moral obligation to your cofounders and people that have invested time in you.

The deal would keep the startup on life support and earn a title. Something to put on a résumé. A badge of honour. Not what you had in mind when you embarked on this endeavour. Signing it would mean lying to yourself, your cofounders, your investors. Far from what you had asked for in the first place.

@qnoid
qnoid / gist:4674581
Created January 30, 2013 16:47
Adds the ability to do a "pod clean" that will remove the Podfile.lock, the ./Pods and xcworkspace under a project.
#pod clean
pod() {
if [ $1 == "clean" ]
then
xcworkspace=$(find . -maxdepth 1 -name *.xcworkspace)
if [ -z $xcworkspace ]
then
echo "Already clean"
else
echo "Will remove Podfile.lock, Pods/ and $xcworkspace"
@qnoid
qnoid / Builder.java
Last active December 15, 2015 11:59
An example showing the new syntactic sugar for constructor reference and lambda expressions introduced in Java 8. Inspired by http://www.techempower.com/blog/2013/03/26/everything-about-java-8/
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
class Person
{
String name;
int age;