Skip to content

Instantly share code, notes, and snippets.

View danurna's full-sized avatar

Daniel Witurna danurna

  • Vienna, Austria
View GitHub Profile
@mcbrwr
mcbrwr / svn-pristine-find.sh
Last active July 8, 2024 09:26
fix for "svn pristine text not present" error in a working copy
#!/bin/bash
# for an "svn pristine text not present" error like this:
# svn: E155010: Pristine text 'd6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8' not present
# you can delete the file and retrieve it with svn up
# (if you have local modifications, make up your own plan)
# -
# Run this script from the root of the working copy.
# It retrieves the file that's causing the error from wc.db
# usage example : ./svn-pristine-find.sh d6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8
@arnaudlamy
arnaudlamy / timeago.swift
Last active July 17, 2019 09:13 — forked from jacks205/timeago.swift
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C) *Swift 2
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components([NSCalendarUnit.Minute , NSCalendarUnit.Hour , NSCalendarUnit.Day , NSCalendarUnit.WeekOfYear , NSCalendarUnit.Month , NSCalendarUnit.Year , NSCalendarUnit.Second], fromDate: earliest, toDate: latest, options: NSCalendarOptions())
if (components.year >= 2) {
return String.localizedStringWithFormat(NSLocalizedString("%d years ago", comment: ""), components.year)
} else if (components.year >= 1){
@pilot34
pilot34 / Fastfile.rb
Last active January 29, 2020 17:37
CircleCI 2.0 iOS Signing without Match
private_lane :prepare_certificates do |options|
sh("base64 -D -o Certificates.p12 <<< \"#{ENV['APPLE_CERTIFICATE']}\"", log: false)
create_keychain(
name: "default_keychain",
default_keychain: true,
unlock: true,
password: "default"
)
import_certificate(
certificate_path: "fastlane/Certificates.p12",