Skip to content

Instantly share code, notes, and snippets.

View marcinczenko's full-sized avatar
💭
https://idbox.online

Marcin Czenko marcinczenko

💭
https://idbox.online
View GitHub Profile
@marcinczenko
marcinczenko / AgileToolbox.xcscmblueprint
Last active August 29, 2015 14:25
Removing unwanted working copies from Xcode 6.4 [Before/After]
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "DB495929FC20F691F10FC8D71CEE93081C1B3A30",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"DB495929FC20F691F10FC8D71CEE93081C1B3A30" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "12F13789-C2BC-4A86-904F-DB7A7D3B0E94",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
@marcinczenko
marcinczenko / TimestampUtils.java
Created November 26, 2015 19:15 — forked from kristopherjohnson/TimestampUtils.java
Methods for generating ISO 8601 timestamps in Java/Android
package net.kristopherjohnson.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
/**
* Methods for dealing with timestamps
@marcinczenko
marcinczenko / Open iterm tab here
Last active December 19, 2015 17:02 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder.To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
-- https://gist.github.com/eric-hu/5846890
-- Modified to work with files as well, cd-ing to their container folder
-- Modified to do an ls -l if the selected item in Finder is a file so that you get the name of the file waiting for you in the terminal.
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
@marcinczenko
marcinczenko / Open in new iTerm2 tab
Created December 31, 2015 04:04
Automator: opens the folder in a new iTerm2 tab.
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@marcinczenko
marcinczenko / Open in new iTerm2 window
Created December 31, 2015 04:05
Automator: opens the folder in a new iTerm2 window.
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
-- https://gist.github.com/eric-hu/5846890
-- Modified to work with files as well, cd-ing to their container folder
-- Modified to do an ls -l if the selected item in Finder is a file so that you get the name of the file waiting for you in the terminal.
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
@marcinczenko
marcinczenko / Check sha256 in iTerm2
Created December 31, 2015 04:07
Automator: check the SHA256 of the selected file in a new iTerm2 window
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
-- https://gist.github.com/eric-hu/5846890
-- Modified to work with files as well, cd-ing to their container folder
-- Modified to do an ls -l if the selected item in Finder is a file so that you get the name of the file waiting for you in the terminal.
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
@marcinczenko
marcinczenko / SwiftStringConversion.playground
Last active February 11, 2016 11:47
Playground demonstrates how can you properly add String conversion to your own classes. See http://blog.redgreenrefactor.eu/post/139107029424/string-conversions-in-swift.
//: Playground - noun: a place where people can play
class MyClass: CustomStringConvertible {
let counter: Int
var description: String {
return "{ counter: \(self.counter) }"
}
init(withCounter: Int) {
@marcinczenko
marcinczenko / AroundTypeErasureInSwift.playground
Created June 28, 2016 17:04
A Swift playground for the blog post "Around TypeErasure in Swift"
import Foundation
protocol Logger {
associatedtype LoggerItemType
func log(item: LoggerItemType)
}
struct AnyLogger<LoggerItemType> : Logger {
import Foundation
import CoreData
protocol EPQuantity {
associatedtype EPQuantityValueType
func getValue() -> EPQuantityValueType
}
struct EPAcceleration: EPQuantity, CustomStringConvertible {
let acceleration: Double

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: