Skip to content

Instantly share code, notes, and snippets.

View JIghtuse's full-sized avatar

Boris Egorov JIghtuse

View GitHub Profile
{"Archimedean spiral",
"Archimedes’ spiral",
"astroid",
"astroid pedal curve",
"bifoliate",
"bifolium",
"butterfly catastrophe curve",
"second butterfly curve",
"cardioid",
"cardioid pedal curve",
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
me:
@true
a:
@true
sandwich:
@[ "$$(id -u)" -eq 0 ] && echo "Okay." || echo "What? Make it yourself."
.PHONY: me a sandwich
@JIghtuse
JIghtuse / fizzbuzz.hs
Last active August 29, 2015 14:02
Haskell FizzBuzz
module Main where
fizzBuzz :: Int -> String
fizzBuzz n
| mod n 15 == 0 = "FizzBuzz"
| mod n 3 == 0 = "Fizz"
| mod n 5 == 0 = "Buzz"
| otherwise = show n
main = do
@JIghtuse
JIghtuse / undead.cpp
Created September 24, 2014 17:41
Undead
class Undead {
~Undead()=delete;
};
@JIghtuse
JIghtuse / scanf
Created November 11, 2014 03:59
%m length specifier allocates as many memory as needed to place input
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#ifdef __GLIBC__
#if !(__GLIBC_PREREQ(2, 7))
#error %m is not available
#endif
@JIghtuse
JIghtuse / network.sh
Created May 11, 2015 08:11
bash-tricks
#!/bin/sh
# get all ipv4 addresses of existing connections
ip -4 -oneline a | awk '{ print $2 ": " $4 }'
@JIghtuse
JIghtuse / model.rs
Last active August 7, 2018 20:35
Rust' Path usage example
use std::path::{Path, PathBuf};
struct Model {
u: f32,
}
fn texture_fname(path: &Path) -> PathBuf {
let fullname = format!("{}{}", path.file_stem().unwrap().to_str().unwrap(), "_diffuse");
let mut buf = PathBuf::from(path);
@JIghtuse
JIghtuse / gist:7340984e80d49f1d4935
Created September 29, 2015 11:09 — forked from jayjanssen/gist:5697813
Testing multicast with iperf
this is a sample of output:
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 226.94.1.1
Joining multicast group 226.94.1.1
Receiving 1470 byte datagrams
UDP buffer size: 122 KByte (default)
------------------------------------------------------------