Skip to content

Instantly share code, notes, and snippets.

View jabbalaci's full-sized avatar

Laszlo Szathmary jabbalaci

View GitHub Profile
@yakimka
yakimka / 1_day05_part2.py311.py
Last active February 11, 2025 20:09
Python versions evolution
"""
This gist contains the solution for
Day 5 of Advent of Code 2023 (https://adventofcode.com/2023/day/5).
I first wrote it on version 3.11 and then ported it
to earlier versions to see how the language evolved.
Below is the listing for version 3.11
"""
from __future__ import annotations
@smvd
smvd / FlappyBird.c
Last active August 28, 2024 08:56
flappy bird writen in c running in the terminal
/*
_ _ _ _____ _ ____ _
| \ | | ___ | |_ | ___| | __ _ _ __ _ __ _ _ | _ \ _ _ ___| | __
| \| |/ _ \| __| | |_ | |/ _` | '_ \| '_ \| | | | | | | | | | |/ __| |/ /
| |\ | (_) | |_ | _| | | (_| | |_) | |_) | |_| | | |_| | |_| | (__| <
|_| \_|\___/ \__| |_| |_|\__,_| .__/| .__/ \__, | |____/ \__,_|\___|_|\_\
|_| |_| |___/
compiler : GCC
command : gcc source.c -o FlappyBird.exe -Werror -Wall -W -s
license : www.unlicense.org (Please credit my channel tho)
@tbjgolden
tbjgolden / inotify-instructions.md
Last active November 27, 2024 14:22
[Arch Linux] [Manjaro] How to avoid "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)

To avoid this error, we need to increase the inotify watcher limit.

The way to do this is different on Arch based distributions than other Linux distributions.

Instructions for Arch Linux/Manjaro

Check for an already existing inotify config file (recent versions of Manjaro include one)

@prantlf
prantlf / main_test.go
Last active March 3, 2023 17:47
Tests and benchmarks for formatting integers with commas separating thousands
// Save this file as main_test.go and run "go test -bench ."
package main
import (
"bytes"
"fmt"
"regexp"
"strconv"
"testing"
@AlmogBaku
AlmogBaku / bitly.go
Last active May 8, 2024 15:36
Golang Bitly: simple, stupid shortener written in go
package bitly
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
const BaseURL = "https://api-ssl.bitly.com/v4"
import matplotlib.pyplot as plt
from PyQt5 import QtCore
import numpy as np
import time
import math
class VisualiseFrequency(QtCore.QThread):
def __init__(self, song, canvas, player):
@fnky
fnky / ANSI.md
Last active April 6, 2025 23:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active April 8, 2025 14:21
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@magnetikonline
magnetikonline / README.md
Last active March 3, 2025 23:19
Python function - test if given file is considered binary.

Python function - is file binary?

Function which determines if a given file is binary.

Test is based on the following algorithm (similar to that implemented within Perl):

  • Empty files are considered text.
  • If not empty, read up to 512 bytes as a buffer. File will be binary if:
    • Null byte is encountered.
    • More than 30% of the buffer consists of "non text" characters.