Skip to content

Instantly share code, notes, and snippets.

Dmitry Vapelnik dvapelnik

Block or report user

Report or block dvapelnik

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
@dvapelnik
dvapelnik / .bashrc
Created Jun 13, 2017 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
View .bashrc
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@dvapelnik
dvapelnik / Symfony2 GraphvizDumper demo
Created Dec 26, 2016 — forked from fgm/Symfony2 GraphvizDumper demo
Demonstrate how to use the GraphViz Dumper in a Symfony 2.4 project.
View Symfony2 GraphvizDumper demo
<?php
/**
* @file
* gvdump.php
*
* @author: Frédéric G. MARAND <fgm@osinet.fr>
*
* @copyright (c) 2014 Ouest Systèmes Informatiques (OSInet).
*
* @license MIT
View install-cpuminer-centos-rhel.sh
#!/bin/sh
yum -y groupinstall "Development Tools"
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh epel-release-5*.rpm
rpm -Uvh remi-release-5*.rpm
yum -y install python-devel screen
yum --enablerepo=remi install libcurl-devel -y
mkdir /opt/miner
cd /opt/miner
@dvapelnik
dvapelnik / .gitconfig
Created Oct 31, 2016
Pretty git branch graphs
View .gitconfig
[alias]
# Look http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@dvapelnik
dvapelnik / cmd.sh
Created Oct 27, 2016 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
View cmd.sh
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@dvapelnik
dvapelnik / ogp.html
Created Oct 25, 2016
OpenGraph Protocol by @maggg
View ogp.html
<!-- Для Фейсбука, Вконтакта, Одноклассников и Гуглплюса -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Название сайта">
<meta property="og:title" content="Заголовок">
<meta property="og:description" content="Описание.">
<meta property="og:url" content="http://example.com/page.html">
<meta property="og:locale" content="ru_RU">
<meta property="og:image" content="http://example.com/img.jpg">
<meta property="og:image:width" content="968">
<meta property="og:image:height" content="504">
View y-factorial.php
<?php
// Source: https://php100.wordpress.com/2009/04/13/php-y-combinator/
function Y($F)
{
$func = function ($f) {
return $f($f);
};
return $func(
function ($f) use ($F) {
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dvapelnik
dvapelnik / meta-tags.md
Created Dec 20, 2015 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@dvapelnik
dvapelnik / run.sh
Created Jul 5, 2015
make file container with some filesystem
View run.sh
#!/bin/bash
# Make file container with 100Gb size
dd if=/dev/zero of=container.ext4 bs=1M count=102400
# Format with ext4 fs
mkfs ext4 -F container.ext4
# Make mount-directory
sudo mkdir -p /mnt/container_dir
You can’t perform that action at this time.