🏳️⚧️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require | |
net/http-easy) | |
(define (base-url path) | |
(string-append "https://httpbin.org" path)) | |
; request: GET | |
; response: plain string body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The definition of color schemes. | |
schemes: | |
gruvbox_material_hard_dark: &gruvbox_material_hard_dark | |
primary: | |
background: '0x1d2021' | |
foreground: '0xd4be98' | |
normal: | |
black: '0x32302f' | |
red: '0xea6962' | |
green: '0xa9b665' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```cpp | |
// Sorry, I don't know which. | |
#define WIN32_MEAN_AND_LEAN | |
#define WIN32_LEAN_AND_MEAN | |
enum class FizzBuzzState : uint32_t | |
{ | |
Fizz = 0b01, | |
Buzz = 0b10, | |
FizzBuzz = Fizz | Buzz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class _Ty> | |
_NODISCARD /* constexpr */ _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept { | |
// on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT | |
const int _Finite_mask = (int{isfinite(_ArgA)} << 2) | (int{isfinite(_ArgB)} << 1) | int{isfinite(_ArgT)}; | |
if (_Finite_mask == 0b111) { | |
// 99% case, put it first; this block comes from P0811R3 | |
if ((_ArgA <= 0 && _ArgB >= 0) || (_ArgA >= 0 && _ArgB <= 0)) { | |
// exact, monotonic, bounded, determinate, and (for _ArgA == _ArgB == 0) consistent: | |
return _ArgT * _ArgB + (1 - _ArgT) * _ArgA; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# encoding: utf-8 | |
""" | |
Flask session cookie toolkit. | |
Decode, verify or generate a signed Flask session cookie. | |
Credits to Terry Vogelsang for the original script (https://terryvogelsang.tech/MITRECTF2018-my-flask-app/) | |
which I just slightly modified for my personal use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import caffe | |
import numpy as np | |
import json | |
class FocalLoss(caffe.Layer): | |
""" | |
Compute Focal Loss | |
Inspired by https://arxiv.org/abs/1708.02002 | |
Raul Gomez Bruballa | |
https://gombru.github.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic | |
===== | |
[Shift]+[Mod]+[Enter] - launch terminal. | |
[Mod]+[b] - show/hide bar. | |
[Mod]+[p] - dmenu for running programs like the x-www-browser. | |
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master. | |
[Mod] + [j / k] - focus on next/previous window in current tag. |
The exception handling block except Exception as ex: print(ex)
will only print the exception message and not its traceback.
That’s good to know, but we need more info than this to debug properly. Namely the line that raised the exception, together with its stack trace.
The traceback
module, part of the stdlib, will help us with this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[~] rofi -dump-xresources | |
The script command 'window' has 1 options, but needs 2: <name>:<script>. | |
Invalid script switcher: window | |
! Enabled modi | |
rofi.modi: window,run,ssh | |
! Window opacity | |
rofi.opacity: 100 | |
! Window width | |
rofi.width: 50 | |
! Number of lines |
NewerOlder