Skip to content

Instantly share code, notes, and snippets.

View Newlifer's full-sized avatar

Newlifer

  • Yaroslavl
View GitHub Profile
@Newlifer
Newlifer / conanpylint.txt
Created November 12, 2018 09:48
conan pylint
************* Module conan.conans.tools
E: 15, 0: function already defined line 6 (function-redefined)
************* Module conan.conans.client.command
E:1572,26: Module 'signal' has no 'SIGBREAK' member (no-member)
************* Module conan.conans.client.conan_command_output
E:125, 8: No name 'PythonLexer' in module 'pygments.lexers' (no-name-in-module)
E:125, 8: No name 'IniLexer' in module 'pygments.lexers' (no-name-in-module)
E:125, 8: No name 'TextLexer' in module 'pygments.lexers' (no-name-in-module)
E:126, 8: No name 'TerminalFormatter' in module 'pygments.formatters' (no-name-in-module)
************* Module conan.conans.client.remote_registry
@Newlifer
Newlifer / pnorm.sv
Created April 7, 2018 16:20
pnorm.sv
/*
* Простой алгоритм параллельной нормализации.
*/
module main();
integer values[3];
bit sum;
integer counter; // ticks count
@Newlifer
Newlifer / git-feature.sh
Created January 9, 2018 12:30
git-feature
#!/bin/bash
rootbranch=`git rev-parse --abbrev-ref HEAD`
milestone=${rootbranch:3}
featurebranch="$milestone/feature/$1"
git checkout -b $featurebranch
@Newlifer
Newlifer / latency.txt
Created November 10, 2017 06:00 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@Newlifer
Newlifer / keymap.hpp
Created July 18, 2017 11:28
keymap.hpp
#pragma once
#include "hashmap.hpp"
#define UNKNOWN_PLATFORM "Unknown platform!"
namespace aim {
enum class VKey : int {
K_Esc,
K_1,
@Newlifer
Newlifer / lock.cpp
Last active June 23, 2017 09:57
lock.cpp
#include <mutex>
namespace aim {
template <typename T>
struct MutexLock {
using value_type = typename T::value_type;
using container_type = T;
MutexLock()
@Newlifer
Newlifer / id_generator.d
Last active June 15, 2017 13:52
id_generator.d
import std.stdio;
import std.uuid;
import std.digest.murmurhash;
import std.format;
import std.bitmanip;
import std.system;
string next_id() {
auto uuid = randomUUID();
MurmurHash3!32 hasher;
@Newlifer
Newlifer / .vimrc
Created April 21, 2017 09:26
.vimrc
set nocompatible
set backspace=indent,eol,start
" improve perfomance
set lazyredraw
set synmaxcol=256
syntax sync minlines=256
set fileencodings=ucs-bom,utf-8,default,latin1
set fileencoding=utf-8
@Newlifer
Newlifer / transmute.rs
Created March 1, 2017 20:59
transmute.rs
use std::mem;
#[derive(Debug)]
struct Rec {
x: u32
}
fn main() {
let array = [8 as u8, 0 as u8, 0 as u8, 0 as u8];
let rec: Rec;
@Newlifer
Newlifer / shared.rs
Created February 2, 2017 16:05
shared.rs
use std::sync::{Arc, RwLock};
struct Foo {
f: Arc<RwLock<i32>>
}
trait Formattable {
fn own_format(&mut self);
}