Skip to content

Instantly share code, notes, and snippets.

Michal Duda vookimedlo

View GitHub Profile
@vookimedlo
vookimedlo / xvfb
Created Dec 18, 2019 — forked from jterrace/xvfb
xvfb init script for Ubuntu
View xvfb
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
@vookimedlo
vookimedlo / MacOS: Set application position and size from CLI.md
Last active Oct 30, 2019
MacOS: Set the application position and size from the command line [AppleScript]
View MacOS: Set application position and size from CLI.md

Dictionary is the application, which shall be adjusted to the position {0, 20} and to the size {1280, 800}.

Note that this is the size of the plain window without a shadow. If you do a screenshot, you can omit a shadow by holding the ⌥ [option] key.

tell application "System Events"
    set ssProcess to first process whose name is "Dictionary"
    tell ssProcess
        tell first window
            set position to {0, 20}
@vookimedlo
vookimedlo / TimeMachine-Raspberry-4.md
Last active Mar 26, 2020
Headless TimeMachine backup solution @ Raspberry 4
View TimeMachine-Raspberry-4.md

Download Image

curl -L https://downloads.raspberrypi.org/raspbian_lite_latest | bsdtar -xvf-

Flash Image

@vookimedlo
vookimedlo / Share.swift
Created Sep 12, 2019 — forked from mosen/Share.swift
Convenient swift-like wrapper over NetFS smb mounting
View Share.swift
import Foundation
import NetFS
enum ShareMountError: Error {
case InvalidURL
case MountpointInaccessible
case InvalidMountOptions
}
@vookimedlo
vookimedlo / gist:79dbc79c18e4bc0f094f02aae2540b70
Created Aug 1, 2019 — forked from KosmicTask/gist:9a3181909b1fe67368f8
NSTableView custom drag image with background and drop shadow based on contents of NSTableCellView -draggingImageComponents
View gist:79dbc79c18e4bc0f094f02aae2540b70
#pragma mark -
#pragma mark NSTableViewDataSource
- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forRowIndexes:(NSIndexSet *)rowIndexes
{
// configure the drag image
// we are only dragging one item
NSTableCellView *cellView = [self.columnsTableView viewAtColumn:0 row:rowIndexes.firstIndex makeIfNecessary:NO];
if (cellView) {
@vookimedlo
vookimedlo / CalculatorView.swift
Created Jul 7, 2019 — forked from nahuelDeveloper/CalculatorView.swift
An IBInspectable Calculator Construction Set
View CalculatorView.swift
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
import UIKit
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
@vookimedlo
vookimedlo / git2dch.sh
Created Apr 20, 2019 — forked from nikicat/git2dch.sh
Shell script to regenerate debian changelog from git log
View git2dch.sh
#!/bin/sh
sudo apt-get install -y moreutils git-buildpackage
>debian/changelog
prevtag=initial
pkgname=`cat debian/control | grep '^Package: ' | sed 's/^Package: //'`
git tag -l v* | sort -V | while read tag; do
(echo "$pkgname (${tag#v}) unstable; urgency=low\n"; git log --pretty=format:' * %s' $prevtag..$tag; git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' $tag^..$tag) | cat - debian/changelog | sponge debian/changelog
prevtag=$tag
@vookimedlo
vookimedlo / windows_batch.md
Created Apr 1, 2019
Windows Batch Scripts: Useful constructs
View windows_batch.md

Change Current Directory to the Batch File Directory

cd /D "%~dp0"

View shell_shortcuts.md
➜  bindkey
"^@" set-mark-command
"^A" beginning-of-line
"^B" backward-char
"^D" delete-char-or-list
"^E" end-of-line
"^F" forward-char
"^G" send-break
"^H" backward-delete-char
@vookimedlo
vookimedlo / interesting_unicode_chars.md
Created Dec 14, 2018
Interesting Unicode Characters
You can’t perform that action at this time.