This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Request = require('request'); | |
const curlToJson = require('curl-to-json'); | |
let old=0; | |
// 1st class | |
const request = curlToJson(`curl 'http://ice.portal1/api1/rs/status' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8,de-DE;q=0.6,de;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://ice.portal1/' -H 'Cookie: scr=1280x0800; vzn=ICE100; Apache=10.205.31.137.1463166299873019' -H 'Connection: keep-alive' -H 'X-Features: {"video":["hds","mp4","ogg"],"audio":["hds","m4a","mpeg","ogg"],"game":["flash","html5"],"browser":"Webkit Version 50.0.2661.94","device":"Sonstiges Device"}' --compressed`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick and dirty NRF52840 PWM abstraction | |
// don't use in production | |
#include "cmsis.h" | |
#include "sdk_config.h" | |
#include "nrf_drv_pwm.h" | |
static const nrf_drv_pwm_t m_pwm_driver[4] = { | |
NRF_DRV_PWM_INSTANCE(0), | |
NRF_DRV_PWM_INSTANCE(1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dependencies: ttyplot, jq, curl | |
{while true; do curl 'https://iceportal.de/api1/rs/status' --silent | jq -r '.speed'; sleep 10; done} | ttyplot -u "km/h" -s 300 -t "Train Speed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'watir-webdriver' | |
require 'telegram/bot' | |
Telegram.bots_config = { | |
default: '<Telegram Bot token>', | |
} | |
Telegram.bot.get_updates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arena = GetElement('Arena') | |
ma2 = GetElement('onpc_main') | |
--set rate/speedmaster executor number (you should fix it in ma) | |
exec_speedmaster = 1 | |
exec_ratemaster = 2 | |
function map(x, out_min, out_max) | |
return (x - out_min) / (out_max - out_min) | |
end |