Skip to content

Instantly share code, notes, and snippets.

View rafaltrojanowski's full-sized avatar
🛰️

Rafał Trojanowski rafaltrojanowski

🛰️
View GitHub Profile
@rafaltrojanowski
rafaltrojanowski / whiteboardCleaner.md
Created March 13, 2019 08:49 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@rafaltrojanowski
rafaltrojanowski / money_best_practices.md
Created November 9, 2018 09:50 — forked from abhinavmsra/money_best_practices.md
Tips for Money Related Arithmetic in Ruby

Tips for Money Related Arithmetic in Ruby

  1. Never use float for performing arithmetic calculations relating to money.

    Floating numbers can sometimes show funky behaviour. It is not Ruby’s fault but the very implementation of floating numbers raises precision issues.

Examples of odd behaviour:

@rafaltrojanowski
rafaltrojanowski / rotate.md
Created August 16, 2018 09:51 — forked from abhinavmsra/rotate.md
Rotating Server Logs

#Rotating Server Logs with LogRotate

Logrotate is a UNIX utility that does following operations:

  1. Rotates the log file when file size reaches a specific size or after a specified duration
  2. Continues to write the log information to the newly created file after rotating the old log file
  3. Compresses the rotated log files
  4. Specifies compression option for the rotated log files
@rafaltrojanowski
rafaltrojanowski / .gitignore
Created August 6, 2018 16:24 — forked from zilkey/.gitignore
curry example - a way to do dependency injection using lambdas
Gemfile.lock
junk.*
@rafaltrojanowski
rafaltrojanowski / weather_o_rama.rb
Created August 6, 2018 10:45 — forked from wulab/weather_o_rama.rb
Weather-O-Rama Inc.’s next generation, Internet-based Weather Monitoring Station
module Subject
def register_observer()
raise NotImplementedError
end
def remove_observer()
raise NotImplementedError
end
def notify_observers()
@rafaltrojanowski
rafaltrojanowski / ffmpeg-install.sh
Created November 14, 2017 05:51 — forked from clayton/ffmpeg-install.sh
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm