Skip to content

Instantly share code, notes, and snippets.

View lynkos's full-sized avatar
🍳
Cooked

lynkos

🍳
Cooked
View GitHub Profile
@miwebguy
miwebguy / TableFilter.js
Created April 28, 2020 15:36
TableFilter.js
/**
* Table Filter
* @usage: <input type="search" onkeyup="Tablefilter(this, 'VReportList')" />\
* where VReport is the id of the table body
*/
function Tablefilter (phrase, _id) {
var words = phrase.value.toLowerCase().split(" ");
var table = document.getElementById(_id);
var ele;
import argparse
import os
import tempfile
import autopy
import img2pdf
def screenshot(top_left, right_bottom, next_page, total_page):
rect_size = (right_bottom[0] - top_left[0], right_bottom[1] - top_left[1])
@GaetanoPiazzolla
GaetanoPiazzolla / avgLoad.js
Last active August 11, 2025 03:45
% CPU in Node.JS
const os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
@plavjanik
plavjanik / macos.reg
Created July 29, 2019 21:26
Wine macOS Settings
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\Mac Driver]
"LeftCommandIsCtrl"="Y"
"RightCommandIsCtrl"="Y"
"LeftOptionIsAlt"="Y"
"RightOptionIsAlt"="Y"
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
@jlyonsmith
jlyonsmith / Mac Keyboard Symbols.md
Last active October 31, 2025 16:58 — forked from Zenexer/Mac Keyboard Symbols.md
List of Mac/Apple keyboard symbols

Common symbols

Modifiers

When a key combination is displayed, the modifiers are written in the order presented here. For example, Control + Option + Shift + Command + Q would be written as ⌃⌥⇧⌘Q.

Sym Key Alt
Control
Option
@marshalhayes
marshalhayes / README.md
Last active July 3, 2024 12:33
TLS encryption of Python sockets using the "SSL" module

README.md

Follow these steps before trying to run any code.

  1. First, generate a Certificate Authority (CA).

openssl genrsa -out rootCA.key 2048

  1. Second, self-sign it.
@caudamus
caudamus / README.md
Last active September 14, 2025 14:50
BNF Parser

BNF parsing

Toy weekend project: make a parser-parser!

This takes in a grammar given in Bakus-Naur Form (BNF), and a program that was written in the provided grammar, and produces an image of Syntax Tree using graphviz.

References:

@fnky
fnky / ANSI.md
Last active November 2, 2025 14:27
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@bergpb
bergpb / convert_pdf_epub.py
Last active November 4, 2024 11:37
Script to convert pdf to epub.
import os
from time import sleep
path = os.getcwd()
files = os.listdir(path)
#install package
os.system('sudo apt install calibre -y && sudo apt update')
#remove espacos e insere _
@jennyknuth
jennyknuth / README.md
Last active March 5, 2025 18:51
Transform an SVG into a data URI—best practice

How to transform an SVG into a data URI

by Jenny Knuth, based on the work of Chris Coyier and Taylor Hunt

A data URI is a nice way to include a web resource without needing to make an HTTP request. Chris Coyier explains the technique nicely in Probably Don't Base64 SVG.

While a PNG might use Base64 encoding, for SVG, there is a better way.

Taylor Hunt's experiments led to this solution for optimizing SVGs in data URIs:

"So the best way of encoding SVG in a data URI is data:image/svg+xml,[actual data]. We don’t need the ;charset=utf-8 parameter (or the invalid ;utf8 parameter…), because URLs are always ASCII."