Skip to content

Instantly share code, notes, and snippets.

View roolo's full-sized avatar

Mailo Světel roolo

View GitHub Profile
@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 / 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 / gist:9138472
Created February 21, 2014 17:07
AngularJS z konzole
var injector = angular.element($0).injector();
undefined
var perm = injector.get('models.users.permissions');
undefined
perm
Object {validate: function}
perm.validate('administrator', 'Contract', 'index');
true
perm.validate('administrator', 'Contract', 'show');
true
@roolo
roolo / mysql2-gem-install.sh
Last active December 25, 2018 07:43
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config
@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 / output.log
Created December 9, 2013 23:05
Ansible – unarchive can't see path
╰─ vagrant provision 1 ↵
[default] Running provisioner: ansible...
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
<127.0.0.1> REMOTE_MODULE setup
ok: [default]
TASK: [Prepare dir for Pebble kit] ********************************************