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
package main_test | |
import ( | |
"testing" | |
) | |
// Compare running: | |
// go1.21 test -bench=. main_test.go | |
// goos: linux |
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
package main | |
import ( | |
"slices" | |
"testing" | |
) | |
// go test -bench=. main_test.go | |
const ( |
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
import pytz | |
import zoneinfo | |
from datetime import datetime, date, time, timezone | |
dt=datetime.combine(date.today(),time(12,0)) | |
tzs='UTC', 'Europe/Moscow', 'Asia/Calcutta', 'Asia/Bangkok', 'Asia/Kuala_Lumpur', 'Asia/Tokyo', | |
print(f"{dt=}") | |
print(f"{dt.replace(tzinfo=timezone.utc)}") | |
print(f"{dt.astimezone(timezone.utc)}") | |
print(f"{dt.astimezone()}") | |
for tz in tzs: |
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/python3 | |
""" | |
Sometimes, while using Google Street View application (for Android) and Ricoh Theta V 360 camera | |
some videos are not shown in application, but they actually still exist and take place in memory card. | |
As memory card is not external and limited by ~20Gb, it's critically important always to have as much space available | |
as possible. | |
!!!This script DO NOT request confirmation to delete files!!! | |
Every time you start it, it will make a request to the camera's web service to use API. |
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 | |
USERNAME=i.polyakov; | |
git diff --cached --name-only | while read FILE; | |
do | |
if [[ "$FILE" =~ ^.+\.(php)$ ]]; | |
then | |
if [[ -f $FILE ]]; | |
then |