Skip to content

Instantly share code, notes, and snippets.

Vladimir Bauer vbauerster

Block or report user

Report or block vbauerster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View reverse_guess.rs
use rand::Rng;
use std::cmp::Ordering;
use std::io;
fn main() {
println!("Set your secret (1-100):");
let mut secret = String::new();
io::stdin()
.read_line(&mut secret)
.expect("Failed to read line");
View http-redirect.go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/url"
"os"
"strings"
@vbauerster
vbauerster / sync_bench.md
Last active Mar 2, 2019
go sync package benchmarks: mbp 2013 vs mbp 2017
View sync_bench.md

Benchmarks done with go 1.12 version.

mbp 2017 results

  • CPU: Intel Core i7-7820HQ @ 2.90GHz
  • RAM: 16 GB 2133 MHz LPDDR3
goos: darwin
goarch: amd64
pkg: sync
BenchmarkCond1-8                   	10000000	       236 ns/op	       0 B/op	       0 allocs/op
View vscode.rc
{
"vim.leader": "<space>",
"vim.easymotion": true,
"vim.neovimPath": "/usr/local/bin/nvim",
"vim.enableNeovim": true,
"vim.insertModeKeyBindings": [
{
"before": [",", "."],
"after": ["<Esc>"]
}
View cVim.rc
let mapleader = " "
"set showtabindices
"set smoothscroll
map g{ previousTab
map g} nextTab
" Code blocks (see below for more info)
getIP() -> {{
httpRequest({url: 'http://api.ipify.org/?format=json', json: true},
function(res) { Status.setMessage('IP: ' + res.ip); });
}}
View wasavi.rc
" exrc for wasavi
set tabstop=4
set number
set jkdenotative
set cursorline
set cursorcolumn
set theme=solarized
" map! is insert mode
map! ,. <esc>
View app.fetch-httpClient.config.js
import {HttpClient} from 'aurelia-fetch-client'
import {Authentication} from './authentication';
import {BaseConfig} from './baseConfig'
import {inject} from 'aurelia-framework';
import {Storage} from './storage';
@inject(HttpClient, Authentication, Storage, BaseConfig)
export class FetchConfig {
constructor(httpClient, authService, storage, config){
this.httpClient = httpClient;
@vbauerster
vbauerster / main.go
Last active Apr 8, 2018
Diff btw chan size 0 and 1
View main.go
package main
import (
"fmt"
"time"
)
func main() {
// c := make(chan struct{}, 1)
c := make(chan struct{})
View nvimrc.local
imap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#getFileType()=='html' && match(getline('.'), '<.*>')<0 ? emmet#expandAbbrIntelligent("\<plug>(emmet-move-next)") :
\ pumvisible() ? "\<C-n>" :
\ "\<TAB>"
View ChromeCacheExctractor.js
// http://www.sensefulsolutions.com/2012/01/viewing-chrome-cache-easy-way.html
(function() {
var preTags = document.getElementsByTagName('pre');
var preWithHeaderInfo = preTags[0];
var preWithContent = preTags[2];
var lines = preWithContent.textContent.split('\n');
// get data about the formatting (changes between different versions of chrome)
var rgx = /^(0{8}:\s+)([0-9a-f]{2}\s+)[0-9a-f]{2}/m;
You can’t perform that action at this time.