Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

View thoretton-edwin's full-sized avatar

Edwin Thoretton thoretton-edwin

  • Slate Digital France
  • Grenoble
View GitHub Profile
@thoretton-edwin
thoretton-edwin / pr_etiquette.md
Created August 14, 2020 07:29 — forked from mikepea/pr_etiquette.md
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@thoretton-edwin
thoretton-edwin / build.gradle.kts
Created November 21, 2019 08:55
Configuration for kotlin src
plugins {
java
kotlin("jvm")
}
repositories {
mavenCentral()
}
dependencies {
@thoretton-edwin
thoretton-edwin / BuilerPatternExample.swift
Last active April 11, 2018 09:36
Swift builder pattern
import Foundation
//sources :
//https://blog.xebia.fr/2016/12/28/design-pattern-builder-et-builder-sont-dans-un-bateau/
//https://jlordiales.me/2012/12/13/the-builder-pattern-in-practice/
//https://pastebin.com/CXyxh658
class Window { }
class Door { }
class Wall { }
@thoretton-edwin
thoretton-edwin / ObservableExtension.kt
Created February 8, 2018 15:05
kotlin on subscribe extension
private fun <T> Observable<T>.subscribe(onNext:(T)-> Unit = {}, context: KFunction<out Unit>? = null) {
this.subscribe({}, { ErrorController().onError("[ ${context?.name} ]",it) })
}
//exemple
private fun onReceiveShareAction(userId: String) {
messenger.sendShareMessage(Recipient(userId)).subscribe(context = ::onReceiveShareAction)
}
@thoretton-edwin
thoretton-edwin / main.dart
Created September 9, 2017 14:47 — forked from mikemimik/main.dart
Flutter: Custom theme data
import 'package:flutter/material.dart';
import 'theme.dart' as Theme;
void main() {
runApp(
new MaterialApp(
title: 'CompanyApp',
color: Theme.CompanyColors.blue[500],
theme: Theme.CompanyThemeData,
home: new Scaffold(
@thoretton-edwin
thoretton-edwin / Gitattributes for Xcode projects
Created May 19, 2017 12:33 — forked from kiero/Gitattributes for Xcode projects
.gitignore & .gitattributes for Xcode projects
# excludes this file from merges
# treats it like binary file
*.pbxproj -crlf -diff -merge
@thoretton-edwin
thoretton-edwin / GalleryImageViewCell.h
Last active April 7, 2016 12:18
Gallery with zoom & snap
@interface GalleryImageViewCell : UICollectionViewCell <UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UIScrollView *scrollContainer;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollHeightLayoutConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollWidthLayoutConstraint;
@end
@thoretton-edwin
thoretton-edwin / duplicateSymbols.txt
Last active August 29, 2015 14:24
iOS common errors
=> Error :
duplicate simbols $viewController.variable in .o .....
=> Solution :
check import if .m is included
=> Source :
http://stackoverflow.com/questions/3231948/duplicate-symbol-issues
@thoretton-edwin
thoretton-edwin / test.m
Created September 19, 2014 14:24
check and launch linkedIn app
BOOL linkedInIsInstalled =
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"linkedin:#profile/9999"]];
if(linkedInIsInstalled)
{
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"linkedin:#profile/9999"]];
}
else
{
@thoretton-edwin
thoretton-edwin / file.m
Created August 20, 2014 10:03
iOS 8 push notification diff
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[application registerUserNotificationSettings:
[UIUserNotificationSettings settingsForTypes:
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{