Skip to content

Instantly share code, notes, and snippets.

@mjbogusz
mjbogusz / clonepwd.plugin.zsh
Last active September 19, 2016 13:45
Oh-my-zsh plugin, 'cloning' last used working directory to newly-opening shells.
local USERNAME=`id -un`
local TMPFILE_NAME=`ls -t /tmp/ | grep -m 1 clonepwd-${USERNAME}-`
if ( [ "${TMPFILE_NAME}" ] ); then
local TMPFILE="/tmp/${TMPFILE_NAME}"
local CLONEDIR=`cat ${TMPFILE}`
if ( [ "${CLONEDIR}" ] ); then
cd "${CLONEDIR}"
fi
else
@mjbogusz
mjbogusz / agnosterzak.zsh-theme
Last active April 22, 2017 18:29
Agnosterzak oh-my-zsh theme with fixed auto-completion shift and subversion status added
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@mjbogusz
mjbogusz / screen_switch_xrandr.zsh
Last active March 2, 2017 19:23
Automatic screen switching for laptops based on xrandr; Checks for connected screens and laptop lid status.
#!/usr/bin/env zsh
local direction="left"
local -a screens; screens=(`xrandr | grep " connected" | awk -F' ' '{print $1}'`)
local lidStatus=`cat /proc/acpi/button/lid/LID/state | awk -F' ' '{print $2}'`
disableAllButLVDS() {
xrandr --output VGA1 --off
xrandr --output HDMI1 --off
@mjbogusz
mjbogusz / nightwatch.json
Last active July 31, 2017 00:26
Nightwatch.js client.perform() issues examples
{
"src_folders" : ["src"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "./node_modules/selenium-standalone/.selenium/selenium-server/3.4.0-server.jar",
@mjbogusz
mjbogusz / ntt_webext_importexport.js
Last active November 22, 2017 23:49
Import/export tiles for WebExtension version of NewTabTools. Paste into console in new tab, then execute `exportTiles()` and `importTiles()`.
// blob to base64:
// https://stackoverflow.com/questions/12786818/file-api-blob-to-json
// https://stackoverflow.com/a/11562550/3217805
// base64 to blob:
// https://stackoverflow.com/a/16245768/3217805
var exportTiles = function() {
Tiles.getAllTiles().then(tiles => {
return Promise.all(tiles.map(tile => {
return new Promise(resolve => {
let fr = new FileReader();
@mjbogusz
mjbogusz / PKGBUILD
Created August 29, 2018 23:53
py3status 3.12 python 3.7 fix
# Maintainer: Alexis "Horgix" Chotard <[email protected]>
# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
pkgname=py3status
pkgver=3.12
pkgrel=1
pkgdesc="An extensible i3status replacement/wrapper written in python"
url="http://www.ultrabug.fr/tag/py3status/"
arch=('any')
license=('custom: Simplified BSD')
@mjbogusz
mjbogusz / obs_twitch_chat.css
Last active April 9, 2023 17:11 — forked from Bluscream/obs_twitch_chat.css
Twitch chat transparent popout for OBS
/*
Twitch chat browsersource CSS for OBS
Just set the URL as https://www.twitch.tv/popout/%%TWITCHCHANNEL%%/chat
And paste this entire file into the CSS box
Original by twitch.tv/starvingpoet modified by github.com/Bluscream
Readjusted for new (2019/2020) Twitch by github.com/mjbogusz
General Settings
*/
body {