Skip to content

Instantly share code, notes, and snippets.

🔨

Rafael Bugajewski rbugajewski

🔨
Block or report user

Report or block rbugajewski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@catlan
catlan / Document.m
Last active Aug 7, 2019
Pages.app like moveToURL:completionHandler: impl. NSIsRelatedItemType key in Info.plist is required
View Document.m
- (void)moveToURL:(NSURL *)url completionHandler:(void (^ __nullable)(NSError * __nullable))completionHandler
{
NSError *error = nil;
NSURL *adjustedURL = nil;
if (![[url pathExtension] isEqualToString:@"testextension"]) {
adjustedURL = [url URLByAppendingPathExtension:@"testextension"];
}
@itst
itst / Pinboard.scpt
Last active Oct 19, 2019
Import and update your Pinboard bookmarks to DEVONthink
View Pinboard.scpt
(* Import and update your Pinboard bookmarks to DEVONthink
Based on work done by Christian Grunenberg on Mon Jan 23 2006,
Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010 and
Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished.
By Sascha A. Carlin <https://sascha.carlin.de/> on 2018-03-07 to set the creation date of new record, show progress bar, use Pinboard Auth Token, use modification date of folder to fetch only recent items
Copyright (c) 2018. All rights reserved. *)
use framework "Foundation"
@klemenzagar91
klemenzagar91 / MulticastDelegateV2.swift
Created Jun 22, 2017
Multicast Delegate with hash table
View MulticastDelegateV2.swift
class MulticastDelegate <T> {
private let delegates: NSHashTable<AnyObject> = NSHashTable.weakObjects()
func add(delegate: T) {
delegates.add(delegate as AnyObject)
}
func remove(delegate: T) {
for oneDelegate in delegates.allObjects.reversed() {
if oneDelegate === delegate as AnyObject {
@mminer
mminer / PreferencesViewController.swift
Last active Sep 10, 2019
NSTabViewController for preferences window that resizes itself to fit activated tab view.
View PreferencesViewController.swift
import AppKit
class PreferencesViewController: NSTabViewController {
private lazy var tabViewSizes: [NSTabViewItem: NSSize] = [:]
override func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) {
super.tabView(tabView, didSelect: tabViewItem)
if let tabViewItem = tabViewItem {
@seraphyn
seraphyn / ttrss-update.service
Created Sep 17, 2015
Start TinyTinyRSS update Service with systemd instead using cron.
View ttrss-update.service
# This file is part of my tinytinyRSSinstallation
# It is used by systemd under Debian Jessie
# WorkingDirectory=/var/www/html/ttrss must be YOUR Installationpath without
# ending slash /
#
# vim /lib/systemd/system/ttrss-update.service
# systemctl enable ttrss-update.service
# systemctl --system daemon-reload
# systemctl start ttrss-update.service
# systemctl status ttrss-update.service
View postgres_odb_backend.c
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@ColinEberhardt
ColinEberhardt / Swift Events
Created Feb 11, 2015
An eventing mechanism for Swift
View Swift Events
/// An object that has some tear-down logic
public protocol Disposable {
func dispose()
}
/// An event provides a mechanism for raising notifications, together with some
/// associated data. Multiple function handlers can be added, with each being invoked,
/// with the event data, when the event is raised.
public class Event<T> {
@ericlbarnes
ericlbarnes / .bowerrc
Created Jan 17, 2015
Laravel Elixir With Bootstrap Sass
View .bowerrc
{
"directory": "vendor/bower_components"
}
@kwilczynski
kwilczynski / check.md
Last active Jul 2, 2019
Recipe / Role check in Chef
View check.md

If you want to check whether a node run_list includes a specific role (upon expansion), then you could use role? method on the Node object:

node.role?('name')

Alternatively, you can see whether either would work for you:

node.roles.include?('name')

node.run_list?('role[name]')

@jbenet
jbenet / simple-git-branching-model.md
Last active Oct 10, 2019
a simple git branching model
View simple-git-branching-model.md

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

You can’t perform that action at this time.