Skip to content

Instantly share code, notes, and snippets.

View carlj's full-sized avatar

Carl Jahn carlj

  • Deutsche Telekom
  • Wiesbaden
View GitHub Profile
@carlj
carlj / ecc_dh.md
Last active October 25, 2019 14:55
ECC encryption with Diffie-Hellman key exchange

Generate private keys

openssl ecparam -name sect571r1 -genkey -noout -out alice_priv_key.pem
openssl ecparam -name sect571r1 -genkey -noout -out bob_priv_key.pem

Extract public key

openssl ec -in alice_priv_key.pem -pubout -out alice_pub_key.pem
openssl ec -in bob_priv_key.pem -pubout -out bob_pub_key.pem
@carlj
carlj / README.md
Last active February 19, 2021 11:36
Coding Challenge

Coding Challenge

Regeln

  • Googlen ist erlaubt
  • Das Spicken der Lösung dagegen verboten
  • der aktive Coder selbst ist stumm, nur seine beiden Pair Programmer dürfen sich mitteilen, diskutieren und Anweisungen geben
  • die höchste Punktzahl laut coderbyte Website gewinnt
  • Die Programmiersprache ist frei wählbar

Challenges

@carlj
carlj / codereview.md
Last active August 29, 2015 14:06
How to codereview

How to do codereview

Step 1: Context

Check what should have been done

Step 2: Git Changes

Check the related git commit

Step 3: Syntax Check

Check if the Dev use the right syntax and follow the styleguide

@carlj
carlj / gist:e01966352a9b238c5696
Created June 30, 2014 17:19
NSFetchedResultController Delegate
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
// The fetch controller is about to start sending change notifications, so prepare the table view for updates.
[self.tableView beginUpdates];
}
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath {
UITableView *tableView = self.tableView;

#iOS Icon Guideline Dieses Dokument soll eine Übersicht über alle benötigten Icons für die iOS Plattformen 6 und 7 geben. Alle Information zu den Größen und die Verwendung der Icosn findet man in den iOS Human Interface Guidelines.

##App Icons

Device Normal Retina iOS 7 Required
iPhone 57 x 57 114 x 114 120 x 120 YES
iPad 77 x 77 144 x 144 152 x 152 YES
@carlj
carlj / rsa-encryption.md
Last active February 28, 2020 07:01
RSA large File En- and Decryption

RSA File De- and Encryption

Docu for encrypt and decrypt a large file with AES and RSA

Keypairs

Generate RSA Keypairs

//generates a private Key with 8196 Bit. 
openssl genrsa -out private.pem 8196
@carlj
carlj / gist:6269897
Last active December 21, 2015 07:18
my "all i use makros"
//
// Makro.h
//
// Created by Carl Jahn
// Copyright (c) 2013 Carl Jahn. All rights reserved.
//
#import <Foundation/Foundation.h>
//NSLogs
@carlj
carlj / gist:6240213
Last active December 21, 2015 03:09
ScroolView Zoom
//
// ZoomView.m
// ZoomView
//
// Created by Carl Jahn on 15.08.13.
// Copyright (c) 2013 Carl Jahn. All rights reserved.
//
#import "ZoomView.h"
NSURL *url = [NSURL URLWithString:@"http://cache-tester.herokuapp.com/contacts.json"];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
[req setValue:@"\"3aa02883a2552b735e60c74ba4100548\"" forHTTPHeaderField:@"If-None-Match"];
AFJSONRequestOperation *op = [AFJSONRequestOperation JSONRequestOperationWithRequest:req
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
#import <Foundation/Foundation.h>
typedef id(^BankAccount)(char *cmd);
typedef id(^CurrentBalanceMethod)(void);
typedef id(^DepositMethod)(double);
typedef id(^WithdrawMethod)(double);
BankAccount CreateBankAccount(double initialBalance)
{
// Initialization