Skip to content

Instantly share code, notes, and snippets.

View pravic's full-sized avatar

pravic

View GitHub Profile
@pravic
pravic / temperature_orangepi5plus.conf
Created July 13, 2023 13:39
RPi-Monitor temperature sensors for Orange PI 5 Plus
########################################################################
# Orange Pi 5+ Temperature sensors information
# Page: 1
# Information Status Statistics
# - SOC temperature - yes - yes
# - bigcore0 temperature - yes - yes
# - bitcore1 temperature - yes - yes
# - littlecore temperature - yes - yes
# - center temperature - no - yes
# - GPU temperature - yes - yes
@pravic
pravic / main.go
Last active July 17, 2020 15:03
Go leak
package main
import (
"path/filepath"
"runtime"
"github.com/sciter-sdk/go-sciter"
"github.com/sciter-sdk/go-sciter/window"
)
@pravic
pravic / collections.tis
Created April 29, 2020 15:48
Extending TIScript collections
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator
// https://fitzgen.github.io/wu.js/
class Iterator
{
this var m = [];
function this(iterable) {
for(var k in iterable) {
this.m.push(k);
@pravic
pravic / minimal.htm
Last active December 11, 2019 19:42
sciter.lite plain-win
<html window-icon="https://sciter.com/wp-content/themes/sciter/!images/favicon.ico">
<head>
<title>Minimalistic Sciter demo</title>
<style>
html {
background: radial-gradient(75% 75%, circle farthest-side, white, orange, rgb(0,0,204));
color: #fff;
}
@pravic
pravic / main.rs
Last active September 16, 2019 14:57
scrabble finder
const WORDS: &str = include_str!("../words.txt");
fn main() {
let pattern = std::env::args()
.nth(1)
.expect("usage: words <pattern> [known letters]")
.to_ascii_lowercase()
.replace(" ", "")
;

Keybase proof

I hereby claim:

  • I am pravic on github.
  • I am pravic (https://keybase.io/pravic) on keybase.
  • I have a public key whose fingerprint is 4106 0605 6FB6 D24A 30C6 D756 21F5 BD57 9D76 0D01

To claim this, I am signing this object:

@pravic
pravic / rust_snippets.py
Created July 24, 2018 18:05
Sublime snippets to VSCode
def parse_xml_snippet(root):
snippet = {}
description = None
for node in root:
if node.tag == 'content':
snippet['body'] = list(node.text.lstrip().splitlines())
elif node.tag == 'tabTrigger':
snippet['prefix'] = node.text
@pravic
pravic / Cargo.toml
Last active May 14, 2017 05:52
scwindemo
[package]
name = "scwindemo"
version = "0.1.0"
[dependencies]
sciter-rs = "0.4.16"
@pravic
pravic / disable-stdafx.patch
Created May 11, 2017 18:19
Disable stdafx.h in Sciter
diff --git a/include/sciter-win-main.cpp b/include/sciter-win-main.cpp
index 9f2699e..104b70a 100644
--- a/include/sciter-win-main.cpp
+++ b/include/sciter-win-main.cpp
@@ -1,4 +1,6 @@
-#include "stdafx.h"
+// It is better to disable stdafx.h by default.
+// And enable it explicitly via /Fstdafx.h compiler option (C/C++ - Advanced - Force Include File).
+// #include "stdafx.h"
@pravic
pravic / hola.cpp
Created April 27, 2016 07:23
Brackets balance
#include <vector>
int verify(const char* input) {
std::vector<char> stack;
while(const char c = *input++) {
if (c == '(' || c == '[' || c == '<') {
stack.push_back(c);
} else if (c == ')' || c == ']' || c == '>') {
if (stack.empty()) { return 0; }
char& prev = stack.back();