Skip to content

Instantly share code, notes, and snippets.

View GoldsteinE's full-sized avatar

Max “Goldstein” Siling GoldsteinE

View GitHub Profile
const WINDOW_SIZE: usize = 10;
struct FloatingWindow {
data: [i64; WINDOW_SIZE],
start_index: usize,
current_size: usize,
}
impl FloatingWindow {
pub fn at(&self, idx: usize) -> i64 {
use std::marker::PhantomData;
const WINDOW_SIZE: usize = 10;
struct FloatingWindow<'a> {
data: [i64; WINDOW_SIZE],
start_index: usize,
current_size: usize,
phantom: PhantomData<&'a i32>
}
const WINDOW_SIZE: usize = 10;
struct FloatingWindow<'a> {
data: [i64; WINDOW_SIZE],
start_index: usize,
current_size: usize,
}
impl<'a> FloatingWindow<'a> {
pub fn at(&self, idx: usize) -> i64 {
const WINDOW_SIZE: usize = 10;
struct FloatingWindow<'a> {
data: [i64; WINDOW_SIZE],
start_index: usize,
current_size: usize,
}
impl<'a> FloatingWindow<'a> {
pub fn at(&self, idx: usize) -> i64 {
#include <cstdio>
#include <climits>
int square(int num) {
int k = 0;
while (true) {
if (k == num * num) {
return k;
}
k += 2;
@GoldsteinE
GoldsteinE / colors.vim
Last active February 24, 2020 00:38
for r/unixporn
" It's not a real config, but the hi commands from my actual ~/.vimrc
" Base color scheme: https://github.com/gosukiwi/vim-atom-dark
colorscheme atom-dark
hi VertSplit ctermbg=NONE guibg=NONE guifg=#455354
hi CursorLine term=NONE cterm=NONE
hi SpellCap guibg=#383900
hi SpellBad guibg=#661400
hi Pmenu guibg=#2d3135 guifg=#a0d1d9
hi PmenuSel guibg=#818890
hi PmenuSbar guibg=#121315
let perl_sub_signatures = 1
set modeline
set incsearch
set encoding=utf-8
set splitbelow
set backspace=indent,eol,start
set updatetime=100
set wildmenu
filetype plugin indent on
let mapleader = ' '
import fuck
fuck('Какой-то', 'текст') # Вывести какой-то текст, плюс название модуля и номер строки
fuck() # Вывести трейсбек
a = 1
fuck.a # Вывести текст "a = 1", плюс название модуля и номер строки
b = fuck.a + 2 # В b будет лежать 3, на экран попадёт то же, что и в предыдущем примере
@fuck.ing
def function(a, b): # Все вызовы функции и их результаты будут логироваться
return a * b
import tokenize
from construct.lexer import CodeElem, LOC
from construct.constructs.basic import BasicConstruct, T
class ConstructImportConstruct(BasicConstruct):
def feed(self, elem: CodeElem) -> None:
if not isinstance(elem, LOC):
return None
variable=`cat <<-EOF
Some
text
EOF`
echo "My syntax highligting is broken. :("