Skip to content

Instantly share code, notes, and snippets.

View dgyesbreghs's full-sized avatar
🗽
Working Remote

Dylan Gyesbreghs dgyesbreghs

🗽
Working Remote
View GitHub Profile
@dgyesbreghs
dgyesbreghs / FirstWeekDay
Created June 30, 2015 12:29
Get first day of a week with Swift
//: Playground - noun: a place where people can play
import UIKit
let today = NSDate.new()
let gregorian = NSCalendar.currentCalendar()
let weekdayComponetns = gregorian.components(NSCalendarUnit.Weekday, fromDate: today)
let compontentsToSubstract = NSDateComponents.new()
git ls-remote --tags origin | awk '/^(.*)(\s+)(.*?)(Nightly_versiontwo_)(.*[0-9])$/ {print ":" $2}' | xargs git push origin
require 'rubygems'
require 'git'
g = Git.open(Dir.pwd)
g.tags.each do |tag|
if tag.name.include? "VersionTwo"
g.delete_tag(tag.name)
end
end
@dgyesbreghs
dgyesbreghs / keybase.md
Last active July 7, 2016 06:22
keybase.md

Keybase proof

I hereby claim:

  • I am dgyesbreghs on github.
  • I am dgyesbreghs (https://keybase.io/dgyesbreghs) on keybase.
  • I have a public key ASBHUNVL9Uq0RDF3qAaha3lJEaJotk5Qpx1JSO2U1Gp1uwo

To claim this, I am signing this object:

@dgyesbreghs
dgyesbreghs / NSString+Base64.h
Created October 27, 2016 18:27
Encode UIImage to Base64 string
//
// NSString+Base64.h
// Pods
//
// Created by Dylan Gyesbreghs on 27/10/2016.
//
//
#import <Foundation/Foundation.h>
import UIKit
extension UIView {
class func newAutoLayoutView() -> Self {
let view = self.init()
view.translatesAutoresizingMaskIntoConstraints = false
return view
}
class var reuseIdentifier : String {
@dgyesbreghs
dgyesbreghs / vector.cpp
Created December 28, 2016 10:25
Overload C++ << operator (vector int)
std::ostream& operator<<(std::ostream &strm, const vector<int> &a) {
for (auto item : a) {
strm << item << std::endl;
}
return strm;
}
//
// UIView+RoundCorners.swift
// PullableView
//
// Created by Dylan Gyesbreghs on 09/06/2017.
// Copyright © 2017 Dylan Gyesbreghs. All rights reserved.
//
import UIKit
// MARK: - Actions
extension ViewController {
func swipeView(_ gesture: UIPanGestureRecognizer) {
guard let subView = gesture.view else { return }
guard let beginCenter = beginCenter else {
if gesture.state == .began {
self.beginCenter = subView.center
}
return
}
//
// MKMapView+ZoomLevel.swift
// Monizze
//
// Created by Dylan Gyesbreghs on 23/06/2017.
// Copyright © 2017 DGyesbreghs. All rights reserved.
// https://oleb.net/blog/2010/05/set-the-zoom-level-of-mkmapview/
//
import MapKit