Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
@noahcoad
noahcoad / readme.md
Last active April 21, 2025 07:36
Code Minecraft with Python on Mac OSX

Code Minecraft with Python on Mac OSX

Here's a step-by-step to get started scripting Minecraft with Python on Mac OSX

@kurtis318
kurtis318 / NVIDIAonLenovoP50andFedora 28.txt
Last active April 21, 2020 19:57
NVIDIA on Lenovo P50 and Fedora 28
I have a Lenovo P50 ThinkPad that I am issued at work. I run the latest Fedora on my primary laptop for years but
have avoided running the NVIDA graphics drivers because installation was manual and could break with kernel updates.
I updated my personal Dell XPS 15 to use the new NVIDIA drivers that are now supported in Fedora 28 I think these were suppose to come from rpm-fusion but it looks like they are in Fedora 28 tree, I could be wrong. The install was as easy as just installing the nvidia-driver package and reboot. This worked without any issues. I could launch nvidia-settings and glxgears without any issues.
The purpose of this Gist post is to document how I got the NVIDIA drivers from Fedora 28 on the P50. It was not as easy as installing nvidia-driver and rebooting.
For starters, here are the specs for the P50:
[root@kwr50p kurtis] # inxi -SG
@webknjaz
webknjaz / orange_hrm_filler.js
Last active August 27, 2018 09:36
This script helps to pre-populate empty days in Orange HRM time tracking solution (https://www.orangehrm.com/)
/* Usage:
* First, fill in any absenses and business trips
* After that open DevTools (normally F12), and then REPL (Esc), and copy-paste this there + hit Enter
* Script will only fill in empty lines, ignoring what you filled in already, so it won't be corrupted
*/
function fill_in_day(tbl_row) {
$(tbl_row.querySelector('td>input[id$="_inTime"]')).val('09:00')
$(tbl_row.querySelector('td>input[id$="_outTime"]')).val('18:00')
$(tbl_row.querySelector('td>input[id$="_breakDuration"]')).val('01:00')
$(tbl_row.querySelector('td>label[id$="_totalWork"]')).val('08:00')

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@Sonophoto
Sonophoto / get_post_example.py
Created December 12, 2017 22:57
Simple example of GET and POST with Cherrypy
import cherrypy
html_header = \
"""
<html>
<head>
<title>Example of GET and POST</title>
</head>
<body>
"""
@gdamjan
gdamjan / ssl-check.py
Last active April 14, 2024 07:16
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@ambivalentno
ambivalentno / test_client_fake_server.py
Created November 17, 2017 13:48
pytest-asyncio aiohttp client testing with fake server
import asyncio
import pathlib
import socket
import ssl
import pytest
import aiohttp
from aiohttp import web
from aiohttp.resolver import DefaultResolver
@emmanueltissera
emmanueltissera / git-apply-patch.md
Created September 13, 2017 02:34
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@lee-pai-long
lee-pai-long / caller_info.py
Last active March 20, 2024 16:42 — forked from techtonik/caller_name.py
Python - inspect - Get full caller info: package, module, (class), function, line.
"""
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@braian87b
braian87b / image-builder-openwrt-lede.sh
Last active December 11, 2024 14:04
Image-Builder Procedure for OpenWRT - LEDE
# ------------------------------------------------------------------------
# Image-Builder Procedure for OpenWRT - LEDE (In this case using Debian x64 NetInstall virtual machine)
# ------------------------------------------------------------------------
su
apt-get update # Optional, make and upgrade too in case it has too many old pakackes.
apt-get install make aria2 screen ncftp -y
screen -
cd ~