This file contains hidden or 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
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 { |
This file contains hidden or 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
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> | |
} |
This file contains hidden or 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
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 { |
This file contains hidden or 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
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 { |
This file contains hidden or 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
#include <cstdio> | |
#include <climits> | |
int square(int num) { | |
int k = 0; | |
while (true) { | |
if (k == num * num) { | |
return k; | |
} | |
k += 2; |
This file contains hidden or 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
" 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 |
This file contains hidden or 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
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 = ' ' |
This file contains hidden or 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 fuck | |
fuck('Какой-то', 'текст') # Вывести какой-то текст, плюс название модуля и номер строки | |
fuck() # Вывести трейсбек | |
a = 1 | |
fuck.a # Вывести текст "a = 1", плюс название модуля и номер строки | |
b = fuck.a + 2 # В b будет лежать 3, на экран попадёт то же, что и в предыдущем примере | |
@fuck.ing | |
def function(a, b): # Все вызовы функции и их результаты будут логироваться | |
return a * b |
This file contains hidden or 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 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 |
This file contains hidden or 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
variable=`cat <<-EOF | |
Some | |
text | |
EOF` | |
echo "My syntax highligting is broken. :(" |