Skip to content

Instantly share code, notes, and snippets.

R Gibim Drowze

  • Fusioneer
  • Dublin, Ireland
View GitHub Profile
@Drowze
Drowze / compositional_fun.rb
Last active Mar 29, 2019
composition operator fun
View compositional_fun.rb
class SubtractTwoInteraction
def self.call(number)
number - 2
end
end
class MultiplyByInteraction
def self.call(number:, by:)
number * by
end
@Drowze
Drowze / Suppressing undesired gem load.md
Created Sep 26, 2018
Suppressing undesired gem/library load. Useful when your project has a undesired gem being loaded. This makes advantage of .pryrc (but irbrc could theorically also be used)
View Suppressing undesired gem load.md

My project .pryrc contained awesome_print load, which I do not appreciate.

require 'awesome_print'
AwesomePrint.pry!

To patch against the .pryrc, which I could not edit at the time, I created another .pryrc at my home folder (~/.pryrc):

module Kernel
  alias :old_require :require
View MedievalNetwork.md

Medieval Network!

In the early middle ages, where magic reigns and the dragons breath, the world nearly came to an end if not by the bravery of the mightiest wizards. Those, who do their magic writing lines of gibberish language may now save the humanity, but not without a social network to orchestrate their plans.

Features that shall belong

Such a crucial network shall never see the light of the day having it not the following:

  • Wizard creation A wizerd has no less than the following: name, age, gender, location (lat,long). A wizard has a bag as well, which shall be filled with gold, food, beer, life potions and mana potions.
View vmux.fish
function vmux --description 'Use tmux inside vagrant instance'
vagrant ssh -- -t 'tmux attach $@'
end
@Drowze
Drowze / update-master.fish
Last active Jul 30, 2018
update-master.fish
View update-master.fish
function update-master --description "update master branch"
set __CUR_BRANCH (git rev-parse --abbrev-ref HEAD)
git checkout master
git pull
git checkout $__CUR_BRANCH
set -e __CUR_BRANCH
end
View cur-branch.fish
function cur_branch --description "Returns the name of the current git branch"
git rev-parse --abbrev-ref HEAD
end
@Drowze
Drowze / Removing audio tracks from mkv.md
Last active Mar 28, 2018
#mkv #mkvmerge Remove audio/subtitle from a batch of mkv files
View Removing audio tracks from mkv.md

Get the ids of the tracks with mkvinfo <file name> e.g.:

video 0
audio_disliked 1 (default)
audio_liked 2
subtitles_disliked 3 (default)
subtitles_liked 4
@Drowze
Drowze / rename_sakura.js
Created Mar 28, 2018
#rename #javascript script to remove CRC code from filenames
View rename_sakura.js
var fs = require('fs')
path = '../Cardcaptor Sakura TV series A-S/'
fs.readdir(path, function(err,files) {
if(err) throw err;
files.forEach(function(file, index) {
replaced_file = file.replace(/\[........\]/, '');
fs.rename(path + file, path + replaced_file, function(err) {
if(err) throw err;
@Drowze
Drowze / INSTRUCTIONS.md
Last active Jan 28, 2018
Setting up a Plex Media Server VM (tested with Virtualbox) with ubuntu server (tested on 16 LTS)
View INSTRUCTIONS.md

DISCLAIMER

Tested under Windows 10 Pro host (1709), Ubuntu server 16 LTS guest, VirtualBox 5.2.4.
Hardware: AMD FX 6300, 8GB Ram (VGA should not matter).

Step-by-step

  • Download Virtualbox and set up a VM with Ubuntu Server (I used 16 LTS). Take note of the VM name.
  • With the VM closed, configure the network adapter as bridged.
  • Install the Ubuntu server normally. Take note of your username (duh!).
  • Add the plex repositories and add the key as trusted:
@Drowze
Drowze / boxstarter.ps1
Last active May 25, 2018 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
You can’t perform that action at this time.