Skip to content

Instantly share code, notes, and snippets.

View dronov's full-sized avatar
🤖
hello

Mikhail Dronov dronov

🤖
hello
View GitHub Profile
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
class Element
attr_accessor :value, :next_value
def initialize(value, next_value)
@value = value
@next_value = next_value
end
end
class SingleLinkedList
FROM debian:latest
RUN apt-get update && apt-get install -y \
git \
wget \
unzip \
screen \
sudo \
sed \
make \
irb(main):009:0> code = <<-END
irb(main):010:0" puts 2+2
irb(main):011:0" END
=> "puts 2+2\n"
irb(main):012:0> puts RubyVM::InstructionSequence.compile(code).disasm
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putself
0003 putobject 2
0005 putobject 2
@dronov
dronov / gist:0846504ba3f5108ed71f
Created March 16, 2015 20:02
ruby --dump parsetree lex4.rb
[mechanic@dwave-laptop learning_ruby]$ ruby --dump parsetree lex4.rb
###########################################################
## Do NOT use this node dump for any purpose other than ##
## debug and research. Compatibility is not guaranteed. ##
###########################################################
# @ NODE_SCOPE (line: 11)
# +- nd_tbl: :code
# +- nd_args:
# | (null node)
@dronov
dronov / lex4.out
Created March 16, 2015 19:05
ruby -y lex4.rb
[mechanic@dwave-laptop learning_ruby]$ ruby lex4.rb
10.times do |n|
puts n
end
[[[1, 0], :on_int, "10"],
[[1, 2], :on_period, "."],
[[1, 3], :on_ident, "times"],
[[1, 8], :on_sp, " "],
[[1, 9], :on_kw, "do"],
[[1, 11], :on_sp, " "],
# /etc/pf.conf
ext_if="re0"
int_if="wlan0"
set skip on lo0
scrub in all
nat on $ext_if from $int_if:network to any -> ($ext_if)
block all
pass in on $int_if from any to any
@dronov
dronov / gist:08e2d5842a34fcd8c50d
Last active August 29, 2015 14:16
sample rc.conf for FreeBSD 10 NAS
hostname="awesome-host"
ifconfig_re0="DHCP"
sshd_enable="YES"
ntpd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
#Wi-Fi
wlans_run0="wlan0"
create_args_wlan0="wlanmode hostap"
@dronov
dronov / DWAVE-KERNEL
Created March 9, 2015 17:53
Kernel config FreeBSD 10
#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
@dronov
dronov / fig-docker-gitlab
Created February 18, 2015 08:16
The fastest way to run Gitlab on linux machine
postgresql:
image: sameersbn/postgresql:9.1-1
environment:
- DB_USER=gitlab
- DB_PASS=secretpassword
- DB_NAME=gitlabhq_production
gitlab:
image: sameersbn/gitlab:7.4.3
links:
- redis:redisio