Skip to content

Instantly share code, notes, and snippets.

View roolo's full-sized avatar

Mailo Světel roolo

View GitHub Profile
@roolo
roolo / screw-thread.py
Last active March 16, 2021 11:00
Screw thread (závit) in blender
import bpy
from math import *
def createMeshFromData(name, origin, verts, edges, faces):
# Create mesh and object
me = bpy.data.meshes.new(name+'Mesh')
ob = bpy.data.objects.new(name, me)
ob.location = origin
ob.show_name = False
# Link object to scene and make active
@roolo
roolo / index.html.erb_spec.rb
Created August 17, 2019 11:50
Rubocop — Layout/AlignHash
FactoryBot.create :user_subscription,
user: current_user,
subscription: FactoryBot.create(:subscription,
:with_provider,
name: "My Subscription #{num}"
)
@roolo
roolo / command.rb
Last active April 2, 2023 16:05
Generate Wifi QR code with Ruby
$ 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 November 26, 2018 21:47
Rick and Morty episodes to watch
  • 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 September 18, 2018 13:12
Removing node from a list
class NumberListNode
attr_accessor :child, :value
def initialize child:, value:
@child = child
@value = value
end
end
@roolo
roolo / command.sh
Created August 23, 2018 00:12
Ansible — machine alias
ansible-playbook -v --inventory inventory playbook.yaml
#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.
@roolo
roolo / README.md
Last active January 12, 2016 13:56

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.

browserIntent = Android::Content::Intent.new Android::Content::Intent::ACTION_VIEW,
URI.parse('http://www.google.com')
startActivity browserIntent
@roolo
roolo / Makefile
Last active November 21, 2015 21:32
Final Cut Pro X backups
sync:
rsync --verbose --recursive --delete --progress \
/Volumes/DATA\ 1/External\ FCP\ Library.fcpbundle/ \
/Volumes/DATA\ 2/External\ FCP\ Library.fcpbundle/