Skip to content

Instantly share code, notes, and snippets.

View catb0t's full-sized avatar
💭
hmm

Cat Stevens catb0t

💭
hmm
View GitHub Profile
@catb0t
catb0t / python_questions.md
Created January 12, 2023 14:40
python questions
  1. A Python list is a mutable ordered collection of values. A Python tuple is an immutable ordered collection of values. A list could be [1, "a", object(), 5]. A tuple could be (1, "a", object(), 5).

  2. A namespace in Python is a syntactic construction, which has a unique identity, a name, and a set of values which are declared and logically stored inside it. Often (and when not private), they can be accessed from outside of the namespace using dot syntax. Modules, files, class declarations, and function definitions all create namespaces.

  3. A global variable is accessible at the file scope, and therefore in all enclosed scopes that inherit outer scopes' globals. If it is not private, a module-global variable is also accessible and mutable by other modules. The scope of a local variable is limited to the class declaration, function definition, with statement, or scoping control block such as if or for in which it was first declared.

  4. An IDE or Integrated Development Environment is a design, eng

@catb0t
catb0t / d
Created January 10, 2023 07:05
{
"ServerName": "The Workers League | VPS testing",
"ServerMessage": "Welcome to The Workers League!
** Only take 16 gifts from Santa at one time. We will kick/ban you if you take more.
If you'd like to join and become a Verified Worker , please join the discord (link below)
** Police is whitelisted , if you'd like to join make a ticket in the discord linked below.
Rules:
interface val Auth
fun val apply[B: Auth val](): B ? =>
this as B
fun val add(that: Auth): AuthSet =>
AuthSet(this, that)
class val AuthSet is Auth
let _a: Auth
let _b: Auth
#SingleInstance Force
ShowNotification(title, text)
{
notif_option := 0x24 | 32
TrayTip(text, title, notif_option)
}
SetMuteAll(state, check)
{
@catb0t
catb0t / mypy_json.pyi
Last active October 3, 2020 09:37
Strict no-Any MyPy JSON type
# modified from Original source: https://github.com/python/mypy/issues/731#issuecomment-539905783
from typing import Union, Dict, List
JSONPrimitive = Union[str, int, bool, None]
JSONType = Union[JSONPrimitive, 'JSONList', 'JSONDict']
# work around mypy#731: no recursive structural types yet
class JSONList(List[JSONType]):
pass

"For too long, the U.S. has turned a blind eye to the atrocities being committed against civilians in Yemen by the Saudi-U.S. coalition…[a] genocidal war that has killed tens of thousands of Yemeni civilians with bombs and mass starvation, creating the worst humanitarian crisis in the world…The time for crocodile tears and baseless platitudes is over. Enough is enough. The U.S must end its support for Saudi Arabia and stop waging interventionist wars [unauthorized by Congress] that increase destruction, death and suffering around the world…"

You wouldn’t be surprised if this was a speech given by Vladimir Putin or Bashar Assad. But this isn’t a quote from the Kremlin or Damascus. It part of a speech by a member of the U.S. Congress who’s joined the running to be selected as the Democratic Party’s presidential nominee: Tulsi Gabbard.

U.S. politicians criticizing imperialist U.S. foreign policy interventions, this time in the Middle East, and helpfully excluding other major world powers’ own interventions, i

@catb0t
catb0t / wordmap.csv
Created May 30, 2019 02:35 — forked from BenTheHokie/wordmap.csv
Phonetically correct word scrambler
I EIGH
J DGE
U OU
S ZE
T TTE
TH CHTH
R EUR
EW IEU
U OU
P PPE
@catb0t
catb0t / bug_const_mod.pl
Created February 26, 2019 06:16
bareword
use lib ("\/home\/cat\/perl5\/lib\/perl5");
use Sidef;
binmode( STDIN, ':utf8' );
binmode( STDOUT, ':utf8' );
binmode( STDERR, ':utf8' ) if $^P == 0;
package Sidef::Runtime {
javascript: (function() {
function RGBtoHSL(RGBColor) {
with(Math) {
var R, G, B;
var cMax, cMin;
var sum, diff;
var Rdelta, Gdelta, Bdelta;
var H, L, S;
R = RGBColor[0];
G = RGBColor[1];
#!/bin/bash
sleep 10
exec redshift-gtk -t5000K:1900K -b1:.7