Skip to content

Instantly share code, notes, and snippets.

View michalmonday's full-sized avatar

Michal Borowski michalmonday

  • Colchester, UK
View GitHub Profile
@classmember
classmember / fbid_3769368939762114.py
Last active October 30, 2020 01:10
Examining various approaches to mathematical software solutions.
# https://www.facebook.com/photo?fbid=3769368939762114&set=gm.1306912559653197
from itertools import chain
import timeit
# Interesting Code Sample
# expected = [x for xs in [[x]*int(expected_dist[x]) for x in range(0, N+1)] for x in xs]
# Original Appraoch
@y56
y56 / ERROR launchpadlib 1.10.6 requires testresources which is not installed
Created April 11, 2020 19:26
ERROR: launchpadlib 1.10.6 requires testresources, which is not installed.
https://www.discoverbits.in/864/error-launchpadlib-requires-testresources-which-installed
==
ERROR: launchpadlib 1.10.6 requires testresources, which is not installed.
+2 votes
asked Oct 6, 2019 in Programming Languages by pythonuser (11.5k points)
recategorized Oct 6, 2019 by pythonuser
I am getting the following error when I try to upgrade setuptools:
@ritiek
ritiek / ffmpeg_stdin.py
Last active April 9, 2024 19:06
Using FFmpeg to read input via stdin in Python
# pip install pytube3
import pytube
import urllib.request
import subprocess
content = pytube.YouTube("https://www.youtube.com/watch?v=YQHsXMglC9A")
streams = content.streams.filter(only_audio=True).order_by("abr").desc()
response = urllib.request.urlopen(streams[0].url)
@Zodt
Zodt / Program.cs
Last active October 3, 2022 05:32
C# Enumerate like in python through Extensions class
// C#9
using System;
using System.Collections.Generic;
foreach (var (value, index) in 5..10)
{
Console.WriteLine($"Value = {value.ToString()}, Index = {index.ToString()}");
}
public static class RangeExtensions
@spacehuhn
spacehuhn / deauthall.md
Last active September 19, 2020 21:53
Deauth-All-Button

Disclaimer

Applying and using the following modifications are up to your responsibility.
I provide this example for you to better understand the code and how such an automatic attack-all could work.
It doesn't mean it will work, I won't provide you with further assistence, or keep this up-to-date.
These modifications make it easy to attack devices you wouldn't want to attack, keep that in mind!
You may easily violate law by using such an attack in public space.


@AhnMo
AhnMo / http_client_get.cc
Last active March 15, 2024 09:50
Wininet HTTP Client Example
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#pragma comment (lib, "Wininet.lib")
int main(int argc, char *argv[]) {
HINTERNET hSession = InternetOpen(
L"Mozilla/5.0", // User-Agent

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@spacehuhn
spacehuhn / arduino_flash_esp8266.md
Last active January 16, 2024 18:14
Flash ESP8266 over an Arduino

How to flash your ESP8266 without a USB-Serial adapter but with an Arduino.

First be sure everything is connected correcly:

Arduino ESP82666
TX RX
RX TX
GND GND
GND GPIO-15
@iminurnamez
iminurnamez / state_engine.py
Last active October 3, 2023 13:04
Simple state engine example
#This code is licensed as CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode).
import sys
import pygame as pg
class Game(object):
"""
A single instance of this class is responsible for
managing which individual game state is active
@benjbaron
benjbaron / QGraphicsSceneTest.cpp
Last active April 22, 2022 03:13
Qt QGraphicsScene click, select, move, resize, delete QGraphicsItems
#include <QtGui>
#include <QGraphicsRectItem>
#include <QGraphicsView>
#include <QApplication>
#include <QGraphicsSceneMouseEvent>
class CustomItem : public QGraphicsEllipseItem
{
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event)