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
Sub CopyHeaderWithEachRow() | |
Doc = ThisComponent | |
Controller = Doc.CurrentController | |
ActiveSheet = Controller.getActiveSheet() | |
NewSheetName = ActiveSheet.Name | |
While Doc.Sheets.hasByName(NewSheetName) |
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
""" | |
https://github.com/openwrt/luci/blob/master/docs/JsonRpcHowTo.md | |
opkg update | |
opkg install luci-mod-rpc luci-lib-ipkg luci-compat | |
/etc/init.d/uhttpd restart | |
""" | |
import httpx | |
class Router: |
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
def flatten_dict(data: dict): | |
"""Transform a dict with nested dicts/list to a one level dict with keys containing paths to | |
the original values encoded as `top_level_key.nested_key[list_item_index]` | |
""" | |
def iterate(_data, _path=""): | |
if isinstance(_data, dict): | |
for _key, _value in _data.items(): | |
yield from iterate(_value, f"{_path}.{_key}".lstrip(".")) | |
elif isinstance(_data, tuple | list): |
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
git for-each-ref --sort=committerdate refs/remotes/origin/ --format='%(committerdate:short) %(authorname) %(refname:lstrip=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
""" | |
This application will calculate the chop saw miter and bevel settings for any angle crown molding. | |
https://play.google.com/store/apps/details?id=com.crownking | |
""" | |
import math | |
wall_angle = 90 # Wall angle | |
sping_angle = 38 # Miter spring angle | |
sa2 = math.radians(sping_angle) |
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
import functools | |
import logging.config | |
import mongoengine | |
import pydantic as p | |
logging.basicConfig() | |
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
root@4f2af8100e1f:# strings /proc/1/environ | |
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
HOSTNAME=4f2af8100e1f | |
COMPUTERNAME=10-30-0-24 | |
PLATFORM_VERSION=97.0.7.610 | |
APPSVC_RUN_ZIP=FALSE | |
WEBSITE_SKU=LinuxFree | |
... | |
------------------------------------------------------------------------------- |
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
import time | |
import math | |
import pygame | |
WIDTH = 320 # width of screen | |
HEIGHT = 240 # height of screen | |
FPS = 30 # frames per second setting |
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
# Make test method names str more friendly for feeding them to ./manage.py test | |
unittest.case.TestCase.__str__ = lambda self: \ | |
f'{self.__class__.__module__}.{self.__class__.__qualname__}.{self._testMethodName}' |
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 | |
import subprocess | |
print('Fetching remote branches...') | |
subprocess.call('git fetch -p --all', shell=True) | |
print('Processing remote branches...') | |
remote_branches = subprocess.check_output( |
NewerOlder