Skip to content

Instantly share code, notes, and snippets.

Avatar
⚜️
Noblesse Oblige

Xevion Xevion

⚜️
Noblesse Oblige
View GitHub Profile
@Xevion
Xevion / bitwise_versus_addition.py
Last active Aug 4, 2022
Bitwise vs Addition in Python (1 million loops)
View bitwise_versus_addition.py
In [1]: def bitwise_or():
...: x = 0
...: for i in range(1, 32):
...: x |= 1 << i
...: return x
...:
In [2]: def addition():
...: x = 0
...: for i in range(1, 32):
@Xevion
Xevion / asb_union.c
Created Jul 7, 2022
Addressed Single Block Write Union Magic
View asb_union.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
struct AddressedSingleBlockWrite {
uint8_t Flag;
uint8_t Command;
uint8_t Address[8];
uint8_t Block;
View magic.c
// Hello world! Cplayground is an online sandbox that makes it easy to try out
// code.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
union magic {
uint8_t buf[4];
uint32_t magic2;
@Xevion
Xevion / common_timezones.txt
Created Jun 19, 2022
Common Timezones provided by Pytz
View common_timezones.txt
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
@Xevion
Xevion / all_timezones.txt
Created Jun 19, 2022
All timezones provided by Pytz
View all_timezones.txt
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
View test.R
library(beakr)
# Create a new beakr server
newBeakr() %>%
# Respond to GET requests at the "/hi" route
httpGET(path = "/hi", function(req, res, err) {
print("Hello, World!")
}) %>%
View speaker_mapping.xml
<SpeakerMappings>
<Mapping count="11686">
<Source>Michael</Source>
<Destination>Michael</Destination>
</Mapping>
<Mapping count="7335">
<Source>Dwight</Source>
<Destination>Dwight</Destination>
</Mapping>
<Mapping count="6632">
View videos.json
{
"subaru": [
{
"id": "yyTJTUNgsVU",
"title": "The Subaru Sambar Is a Cute, Surprisingly Practical Tiny Van"
},
{
"id": "vCOYkYwEXPE",
"title": "The 2023 Subaru Solterra Is an Electric Crossover for Adventures"
},
View penalty.py
>>> def max_penalized(n: float, penalty: float = 0.4) -> float:
return n + (100 - n) * (1 - penalty)
>>> max_penalized(85.56)
94.224
View flask-logs
2022-03-30T07:14:44.969115+00:00 heroku[web.1]: State changed from crashed to starting
2022-03-30T07:14:53.852467+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2022-03-30T07:14:56.063853+00:00 heroku[web.1]: State changed from starting to up
2022-03-30T07:14:55.684562+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Starting gunicorn 20.1.0
2022-03-30T07:14:55.685249+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Listening at: http://0.0.0.0:32157 (4)
2022-03-30T07:14:55.685322+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [4] [INFO] Using worker: sync
2022-03-30T07:14:55.704518+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [10] [INFO] Booting worker with pid: 10
2022-03-30T07:14:55.788814+00:00 app[web.1]: [2022-03-30 07:14:55 +0000] [11] [INFO] Booting worker with pid: 11
2022-03-30T07:15:04.154942+00:00 app[web.1]: Collecting en_core_web_sm==2.3.1
2022-03-30T07:15:04.319253+00:00 app[web.1]: Collecting en_core_web_sm==2.3.1