Skip to content

Instantly share code, notes, and snippets.

Mailo Světel roolo

View GitHub Profile
@roolo
roolo / command.rb
Last active Nov 27, 2018
Generate Wifi QR code with Ruby
View command.rb
$ gem install rqrcode
$ irb -r rqrcode
2.5.3 :001 > File.open('/tmp/wifi-connection.png', File::CREAT | File::WRONLY) {|f| f.write RQRCode::QRCode.new('WIFI:S:Wifi name;T:WPA;P:wifi password;;').as_png(size: 400)
@roolo
roolo / RICKME.md
Created Nov 26, 2018
Rick and Morty episodes to watch
View RICKME.md
  • Total Rickall
  • Get Schwifty
  • Rickshank Rickdemption
  • Pickle Rick
  • A Rickle In Time
  • The Ricks must be crazy
  • Rick Potion #9
  • Auto Erotic Assimilation
@roolo
roolo / remove-node-from-a-list.rb
Last active Sep 18, 2018
Removing node from a list
View remove-node-from-a-list.rb
class NumberListNode
attr_accessor :child, :value
def initialize child:, value:
@child = child
@value = value
end
end
@roolo
roolo / command.sh
Created Aug 23, 2018
Ansible — machine alias
View command.sh
ansible-playbook -v --inventory inventory playbook.yaml
View Text_on_2_line_display.ino
#include <LiquidCrystal.h>
String lcdLine = "";
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
View README.md

Upgrading data from Postgres 9.4 to Postgres 9.5

Solving the The data directory was initialized by PostgreSQL version 9.4, which is not compatible with this version 9.5.0. panic ;) This is mainly for Postgres installed via Homebrew, but you can adapt it to your system pretty easily.

View current_page_in_browser.rb
browserIntent = Android::Content::Intent.new Android::Content::Intent::ACTION_VIEW,
URI.parse('http://www.google.com')
startActivity browserIntent
@roolo
roolo / Makefile
Last active Nov 21, 2015
Final Cut Pro X backups
View Makefile
sync:
rsync --verbose --recursive --delete --progress \
/Volumes/DATA\ 1/External\ FCP\ Library.fcpbundle/ \
/Volumes/DATA\ 2/External\ FCP\ Library.fcpbundle/
@roolo
roolo / stairs.rb
Last active Aug 29, 2015
Do it once!
View stairs.rb
unless defined? @already
UI.menu("Plugins").add_item("Draw stairs") {
UI.messagebox("I'm about to draw stairs!")
# Call our new method.
draw_stairs
}
UI.menu("Plugins").add_item("Reload stairs") {
load 'stairs.rb'
}
@roolo
roolo / Inter.java
Last active Aug 29, 2015
JRuby tryout result
View Inter.java
//package cz.codeland.gunlicensetester.util;
import java.util.ArrayList;
import java.util.Arrays;
public class Inter
{
private ArrayList<Integer> array;
public Inter(Integer... integers)
You can’t perform that action at this time.