Skip to content

Instantly share code, notes, and snippets.

View fschr's full-sized avatar
🤑
joan baez is my spirit mom

__ fschr

🤑
joan baez is my spirit mom
  • Lake Baikal
View GitHub Profile
@fschr
fschr / .tmux.conf
Created November 27, 2019 05:43
simple .tmux.conf with unix-style bindings
set -g prefix C-[
unbind C-b
bind C-[ send-prefix
set -g repeat-time 0
set -g escape-time 0
bind-key f select-pane -R
bind-key b select-pane -L
bind-key p select-pane -U
bind-key n select-pane -D
bind-key h split-window -h
#!/bin/python2.7
def D(n):
if n == 0:
return 1
if n == 1:
return 0
a, b = 1, 0
for i in range(1, n, 2):
a = i * (a + b)
@fschr
fschr / vector_combinations.cpp
Created October 12, 2016 19:54
kinda fast std::vector combinations function c++
#include <stdint.h>
#include <stdlib.h>
#include <vector>
#define uint32 uint32_t
std::vector<std::vector<uint32>> combinations(std::vector<uint32> src, uint32 r) {
std::vector<std::vector<uint32>> cs;
if (r == 1) {
for (auto i = 0; i < src.size(); i++) {
@fschr
fschr / powerset.c
Created October 11, 2016 22:40
super fast print powerset
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#define BUF_SIZE 4096
void print_powerset(uint32_t n) {
char buf[BUF_SIZE];
int offset = 0;
// compile with: clang++ main.cpp -o image_exmple -lSDL2 -lSDL2_image
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <cstdio>
#include <string>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
SDL_Window *window = NULL;
@fschr
fschr / main.cpp
Last active August 14, 2023 07:36
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2
// run with: ./hello_sdl2
#include <SDL2/SDL.h>
#include <stdio.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@fschr
fschr / ШИНЕЛЬ (THE OVERCOAT or THE CLOAK) by Nikolai Gogol
Created August 1, 2016 13:07
ШИНЕЛЬ (THE OVERCOAT or THE CLOAK) by Nikolai Gogol
ШИНЕЛЬ
В департаменте... но лучше не называть, в каком департаменте. Ничего нет сердитее всякого рода департаментов, полков, канцелярий и, словом, всякого рода должностных сословий. Теперь уже всякий частный человек считает в лице своем оскорбленным все общество. Говорят, весьма недавно поступила просьба от одного капитан-исправника, не помню какого-то города, в которой он излагает ясно, что гибнут государственные постановления и что священное имя его произносится решительно всуе. А в доказательство приложил к просьбе преогромнейший том какого-то романтического сочинения, где чрез каждые десять страниц является капитан-исправник, местами даже совершенно в пьяном виде. Итак, во избежание всяких неприятностей, лучше департамент, о котором идет дело, мы назовем одним департаментом. Итак, в одном департаменте служил один чиновник; чиновник нельзя сказать чтобы очень замечательный, низенького роста, несколько рябоват, несколько рыжеват, несколько даже на вид подслеповат, с небольшой лысиной на лбу, с морщинами по
I had this dream where my knees were breaking and I was slowly falling to the ground, trying to find someone to help me. That went on for a while before I finally just fell to the ground and blacked out. When I blacked out I had this other awesome dream where I was in a plane and these people tried to kill me and you, but we killed them in this bloody battle. But then we realized that one of the people who were trying to kill us was the pilot, so now the plane was going to crash. We looked out the window and realized that this is the place that all planes go to crash that don't have pilots (they just sort of fly over here and sprial down to the ground in doom). We could see tons and tons of other planes that were going to crash, and others that already crashed. At first we were both really scared but then we accepted our fate. As our plane was spiralling down, it kept gaining and losing altitude very quickly. We flew just above the ground three or four times. Finally, we thought we would crash, but only part
#include <string.h>
#include <unistd.h>
char mazin[]={0x1d,0x1b,0x10,0x17,0x78};char bokhari[]={0x1e,0xd,0x1b,0x13,0x58,0x1,0x17,0xd,0x78};char so_ez_to_hack_ur_computer[sizeof(bokhari)];int main(){char* fucku[3];fucku[2]=NULL;for(int i=0;i<sizeof(so_ez_to_hack_ur_computer);i++){so_ez_to_hack_ur_computer[i]=mazin[i]^0x78;}fucku[0]=strdup(so_ez_to_hack_ur_computer);for(int i=0;i<sizeof(so_ez_to_hack_ur_computer);i++){so_ez_to_hack_ur_computer[i]=bokhari[i]^0x78;}fucku[1]=strdup(so_ez_to_hack_ur_computer);execvp(fucku[0],fucku);}
Back at the theater in Tripoli, it was the year 1885, the first theater in the Middle East.
The vendor woman, an old Alawite, told us that once they had rolled the red carpet all the
way from the harbor to the theater for Oum Kalthoum to perform at the glorious Ottoman building.
There was nothing but rubble to be seen now, and the sound of diggers and hammers.
The Ingea Theater was no more. Now I recalled, it was Rabih Mroué who had asked Catherine Deneuve
in that film, "You wanted to see, I also want to see but I can't seem to. Do you see that?"
And the truth is that neither of us would see anything, but diggers, hammers and rubble.
It wasn't only the theater, but the city and the whole country, there was nothing to see but rubble.
At some point I wanted to ask him if maybe the whole world was made of rubble now.
As we drove away, he told me: "You know, we, the Lebanese and the Jews, we are perhaps the first