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 python3 | |
""" | |
Test Python | |
Write a function that builds a tree based on a list of tuples of id (parent id, offspring id), | |
where None is the id of the root node. | |
How this should work: | |
""" |
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 bash | |
# help set | |
set -e | |
CURR_DIR=${PWD##*/} | |
FILENAME=${1} | |
NEWRESOLUTION="${2:-1260:720}" | |
NEWFRAMERATE="${3:-24}" | |
THREADS="${4:-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
# enable ssh service, /etc/ssh/sshd_config.d/finnix.conf | |
passwd | |
service ssh restart |
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 | |
exec > my_image.ppm # output file | |
echo "P3 250 250 255" # format, width, high, max color depth | |
for ((y=0; y<250; y++)) { | |
for ((x=0; x<250; x++)) { | |
#echo "$((x^y)) $((x^y)) $((x|y))" # r, g, b # black & blue | |
#echo "$((x)) $((y)) $((x|y))" # r, g, b # color | |
echo "$((x)) $((y)) $((x^y))" # r, g, b # bright color |
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
"ignore vim -u ~/.vimrc | |
"set autoindent | |
"set smartindent | |
syntax on | |
set number | |
set nowrap | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set showtabline=2 |
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 | |
function my_emj() | |
{ | |
EMOJIS=(๐ฆ ๐ฆ ๐ฅ ๐ฆ ๐ฆ ๐ ๐ฃ ๐ค ๐ฅ ๐ก ๐ฅ ๐ฅ ๐คฏ ๐คช ๐คฌ ๐คฎ ๐คซ ๐คญ ๐ง ๐ ๐ฆ ๐พ \ | |
๐ ๐ ๐ ๐ ๐ข ๐ ๐ ๐ ๐ป ๐ท ๐ญ ๐จ ๐ฟ ๐ ๐ง ๐ฆ ๐ ๐น ๐บ ๐ป ๐ฝ ๐ ๐ ๐ฉ ๐ฐ \ | |
๐ฑ ๐ ๐ ๐ง โ ๐ฐ ๐ ๐ ๐ ๐ค ๐ค ๐ฒ) | |
EMJ=${EMOJIS[$RANDOM % ${#EMOJIS[@]}]}; | |
echo $EMJ | |
} |
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 python3 | |
"""fib.py fibonacci numbers | |
usage: python3 fib.py """ | |
import sys | |
def main(mx=99): | |
fib=[1, 1, 0] |
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 python3 | |
""" | |
convert rgb to hsv | |
usage: python3 rgb2hsv.py "FF9D30FF" | |
homekit.json |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
const char *ssid = "name"; | |
const char *pass = "pass"; | |
WiFiClient wclient; | |
IPAddress mqtt_server(192,168,0,20); | |
PubSubClient client(wclient, mqtt_server); |
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 python | |
"""20/10/2017 - 30/11/2017 hjltu@ya.ru | |
github = https://gist.github.com/hjltu/597b1047cd3ed1d264457791b023a966.js | |
mydp.py contain methods for sqlite3 operations: | |
create() - create new table | |
options not requared * | |
drop() - drop table | |
options not requared * |