Skip to content

Instantly share code, notes, and snippets.

View michalvalasek's full-sized avatar

Michal Valasek michalvalasek

View GitHub Profile
@michalvalasek
michalvalasek / minecraft_server_setup.md
Last active April 27, 2020 16:23
Minecraft Server setup

The basic ubuntu instance on DO is ok. SSH to the instance and:

  1. sudo apt-get update
  2. java -version # should say "No java"
  3. sudo apt-get install default-jdk
  4. sudo apt-get install screen # keep server running when disconencted
  5. mkdir minecraft
  6. cd minecraft
  7. wget -O minecraft_server.jar https://launcher.mojang.com/v1/objects/4d1826eebac84847c71a77f9349cc22afd0cf0a1/server.jar # replace by the newest version
{
"event"=>"driver",
"type"=>"update",
"data"=>{
"status"=>"busy",
"latitude"=>51.49221,
"longitude"=>-0.1873,
"name"=>"Jules Funk",
"firstname"=>"Delpha",
"lastname"=>"Ryan",
@michalvalasek
michalvalasek / .mertrc
Created May 28, 2018 07:52
Mert config file example
tmacs:
root: "~/Code/ruby/rails/tma-crowdsource"
launch_strategy: tab
layout:
-
- be rails s
- ./bin/webpack-dev-server
-
paloma:
@michalvalasek
michalvalasek / .chunkwmrc
Created May 1, 2018 13:53
chunkwm configuration
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
@michalvalasek
michalvalasek / main.js
Created January 9, 2018 15:10
Pell - minimalist WYSIWYG editor
// Initialize the editor
pell.init({
element: document.querySelector('.pell'),
actions: ['bold','italic','olist','ulist','clearformat']
});
@michalvalasek
michalvalasek / ayu-dark-custom.tmTheme
Last active October 3, 2017 11:08
Customized Ayu Dark color scheme for Sublime Text 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Ike Ku</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>name</key>
<string>ayu</string>
@michalvalasek
michalvalasek / nintendo-switch-getter.py
Created April 15, 2017 17:42 — forked from bryanhelmig/nintendo-switch-getter.py
A script that watches prime now for stock, sending a webhook to Zapier which you can configure to send you an SMS, Slack, whatever...
import time
import bs4
import requests
import logging
import sys
logger = logging.getLogger('switchlogger')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
@michalvalasek
michalvalasek / example.cr
Created June 30, 2016 08:37
Weird crystal error
f = File.new("buffer_i_gen_batt.txt")
6.times do
_ = f.gets
end
interval = f.gets
def real_val(raw_val)
(raw_val - 520) * 0.191
@michalvalasek
michalvalasek / index.html
Last active June 9, 2016 13:08
Adaptive Slick Slider
<!-- put mobile (smaller) images URIs to the data-images attribute, separate them by semicolon -->
<div id="slider-mobile" class="slick-slider" data-images="http://dummyimage.com/300x200/000/00f;http://dummyimage.com/300x200/000/f00;http://dummyimage.com/300x200/000/0f0">
</div>
<!-- put desktop (larger) images URIs to the data-images attribute, separate them by semicolon -->
<div id="slider-desktop" class="slick-slider" data-images="http://dummyimage.com/600x400/000/00f;http://dummyimage.com/600x400/000/f00;http://dummyimage.com/600x400/000/0f0">
</div>
@michalvalasek
michalvalasek / embed_many_different.rb
Last active May 31, 2016 13:15
Mongoid - embed multiple documents of different types
class Article
include Mongoid::Document
field :title, type: String
embeds_many :widgets, as: :widgetable
end
class Widget
include Mongoid::Document