Skip to content

Instantly share code, notes, and snippets.

View monorkin's full-sized avatar
👻
Boo!

Stanko Krtalić monorkin

👻
Boo!
View GitHub Profile
@monorkin
monorkin / cv.md
Last active October 2, 2016 20:34

Stanko Krtalić Rusendić

I'm a 23 year old interested in software development, computer science, IoT and photography. Most of all I love creating software that people love to use and which makes their lives easier. I'm also a regular speaker at Zag.rb.

Contact

@monorkin
monorkin / WAT.rb
Last active September 17, 2016 21:23
# Example 1
module Logger
extend self
attr_accessor :output, :log_actions
def log(&event)
self.log_actions ||= []
self.log_actions << event
end

Server setup guide

Setting up a bare metal server

Passwordless authentification

After purchasing a bare metal server and receiving it's IP address and password, the first thing you need to do is connect to it using SSH.

require 'rspec/autorun'
module Memoizer
def memoize(method_name)
method = instance_method(method_name)
define_method(method_name) do |*args|
variables = instance_variables.each_with_object({}) do |name, hash|
hash[name] = instance_variable_get(name) unless name == :@memoization
end
@monorkin
monorkin / clean_docker.sh
Last active December 1, 2016 12:53
Script for cleaning garbage docker files
# Remove stopped images
echo "Removing unused containers..."
if [[ -z $(docker ps -a -q) ]]
then
echo "No unused containers found."
else
docker rm $(docker ps -a -q)
fi
# Remove dangling volumes
@monorkin
monorkin / arduino-com
Last active January 12, 2017 13:37
Simple script for sending and reading serial data from your Arduino on *nix systems
#!/bin/bash
# Configuration
DEVICE=/dev/ttyACM0
BAUD=9600
SEND=""
FOLLOW=0
RECEIVE=0
HELP=0

Keybase proof

I hereby claim:

  • I am stankec on github.
  • I am monorkin (https://keybase.io/monorkin) on keybase.
  • I have a public key ASDDUMYqWMcsxPpKftv97h-jN911JPqFYX-8MZmToeu3dgo

To claim this, I am signing this object:

@monorkin
monorkin / iterm_theme_to_alacritty.rb
Created May 11, 2018 08:54
Script that converts iTerm themes to Alacritty
#!/usr/bin/env ruby
# frozen_string_literal: true
# USAGE:
# curl https://gist.github.com/stankec/.../iterm_theme_to_alacritty.rb > iterm_theme_to_alacritty.rb
# chmod +x iterm_theme_to_alacritty.rb
# ./iterm_theme_to_alacritty.rb path/to/your/theme.itermcolors
#
# This will output the config to the terminal
#
SELECT licenses.license AS license, COUNT(licenses.repo_name) AS count
FROM [bigquery-public-data:github_repos.licenses] AS licenses
JOIN [bigquery-public-data:github_repos.languages] AS languages ON licenses.repo_name = languages.repo_name
WHERE languages.language.name = '<language name>'
GROUP BY license

Keybase proof

I hereby claim:

  • I am monorkin on github.
  • I am monorkin (https://keybase.io/monorkin) on keybase.
  • I have a public key ASDDUMYqWMcsxPpKftv97h-jN911JPqFYX-8MZmToeu3dgo

To claim this, I am signing this object: