
This file contains 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 | |
# calculatin of centroid of a polygon | |
# original: https://stackoverflow.com/a/43747218/2848530 | |
# 04/2022 created | |
from typing import List | |
class Point: | |
def __init__(self, x: float, y: float): |
This file contains 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
# 05/2021 created | |
# | |
# hex mesh generation | |
# | |
# nce == numColsEven | |
# | |
# ====== EVEN ====== | |
# | |
# patternEven_1: +1 +2 +2 -1 -2 | |
# patternEven_2: +2 +3 +3 -2 -3 |
This file contains 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
<?php | |
// 07/2020 test for creating a cli script to convert bootstrap3 to bootstrap4 | |
include(__DIR__ . "/../vol/www/vendor/autoload.php"); | |
use GuzzleHttp\Client; | |
$url = 'http://upgrade-bootstrap.bootply.com/'; | |
$formData = [ |
This file contains 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
<?php | |
use Symfony\Component\VarDumper\Cloner\VarCloner; | |
use Symfony\Component\VarDumper\Dumper\AbstractDumper; | |
use Symfony\Component\VarDumper\Dumper\HtmlDumper; | |
/** | |
* Uses symfony's var-dumper for pretty treeview of decoded json in table and edit view. | |
* needs symfony/var-dumper, install with: |
This file contains 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
# 06/2019 | |
# test mysql connector | |
# install with: pip3 install mysql-connector | |
import mysql.connector | |
mydb = mysql.connector.connect( | |
host="localhost", | |
user="root", | |
passwd="11111", |
This file contains 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
ffmpeg -re -i ./video.mp4 \ | |
-acodec libvo_aacenc -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 1280x720 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace \ | |
-vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp://live-api-s.facebook.com:80/rtmp/THE-SECRET-KEY" |
This file contains 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
sudo apt install qt5-qmake | |
export QT_SELECT=qt5 | |
./make_tr.py # generates .qm translation files in i18 directory | |
./make_py_uic.py # generates: dxf2gcode_ui5.py and dxf2gcode_images.qrc | |
python3 ./st-setup.py build | |
sudo python3 ./st-setup.py install | |
dxf2gcode |
This file contains 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 | |
# | |
# original: https://gist.github.com/dokterbob/880378 | |
# 10/2017 updated to work with php files | |
# | |
# usage: | |
# find src/ -name "*.php" -exec shell/copywriter.py some_docheader.txt {} \; | |
import sys |
This file contains 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
require 'rubygems' | |
require 'geonames' | |
places_nearby = Geonames::WebService.find_nearby_place_name 43.900120387, -78.882869834 | |
p places_nearby | |