Skip to content

Instantly share code, notes, and snippets.

@Raidok
Raidok / flow.png
Last active November 6, 2016 01:29
node-red sensorTag and Wii-Scale flow
flow.png
@Raidok
Raidok / index.html
Last active December 13, 2015 21:37
nginx proxy
<!DOCTYPE html>
<html>
<head>
<title>OSMC</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<style>
html, body {
height: 100%;
}
@Raidok
Raidok / controller.lua
Last active August 29, 2015 14:07
WR703N + OpenWRT cat feeder
-- lucidir/controller/cats.lua
module("luci.controller.cats", package.seeall)
function index()
entry({"cats"}, cbi("cats"), "Feed cats", 30).dependent=false
end
@Raidok
Raidok / gist:9133578
Created February 21, 2014 12:40
How many connections are wasted at each cycle?
public void run() {
try {
openConnections();
...
if (use_expiring) {
openConnections();
...
dl.setConnection(dbm.getWrite().getConnection());
..
}
@Raidok
Raidok / elmo.sh
Last active December 31, 2015 03:38
Parsib https://rent.elmo.ee lehelt välja rendipunktid ja neis olevad vabad autod
#!/bin/sh
ON1=`echo "\033[44m\033[37m"`
ON2=`echo "\033[34m"`
OFF=`echo "\033[0m"`
curl https://rent.elmo.ee 2>&1 | sed -n "/metronic_v1.1/,/END JAVASCRIPTS/p" | sed -n -e "s/.*title: \"\(.\+\)\".*/\n$ON1\1$OFF/p" -e "s/.*car_fullname='\" + \"\(.\+\)\" + \"' car_battery='\" + \"\(.\+\)\" + \"' val='\".*/\1 $ON2\2%$OFF/p"
echo
@Raidok
Raidok / AwesomePanel.java
Last active December 28, 2015 04:59
A terrible example of using Listeners in a Swing application, do not try this at home
// this code had been heavily adjusted for the sake of readability
JTable tbl = new JTable(new MyTableModel());
tbl.addMouseListener(new ButCmd(this, ButCmd.CMD_UPDATE));
// [...]
JPanel panel = new JPanel(new FlowLayout());
JButton jb;