Skip to content

Instantly share code, notes, and snippets.

💭
:trollface:

Victor Maslov Nakilon

💭
:trollface:
Block or report user

Report or block Nakilon

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
@Nakilon
Nakilon / id_rsa.pub
Created Sep 26, 2019
macbook 2017 pub key
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyqfb/JsmNKlCSCC9F+VhG0tsxHhGEMMIyjpenIX97cPKjC6SL1S0APoxta7YdHgOYwOD76n3VuJoOSAcQ0FeY6i+PmONnrfAXFrpknyr1e6FwWyNQACZj+df7nowLy8l5AmLpy2U8gd6zpCN/0SPaeyxLcouBNgEU+AfItsJqg8dN2pMsJAH5eGAflWqBlPUhRlqXhxQHTrY2WAbiHoxrSj9becaWa3aL8k2wTS3TVpGQGAgzNYNa4bSrm70mPJvUvReP13KymfJkKoRv/7ZgQBCD7pHDf0tu0kwh0CE4RvsydARHbsKIYeZh70v7YYBGZ48tvOqov9A6ztQ1u9YR nakilon@gmail.com
@Nakilon
Nakilon / gist:959835ebbb474ad072ca98e26fc96e4f
Created Dec 3, 2018
QuakeLive dedicated server guide draft; the rest is somewhere on another machine
View gist:959835ebbb474ad072ca98e26fc96e4f
screen -x workshop
steamcmd +login anonymous +workshop_download_item 282440 539421606 +quit
screen -x server
QLDS_RCON_PASS=... QLDS_STATS_PASS=... ./run.sh 0
steam@ql:~$ tree qlds_fs_homepath/27960/
qlds_fs_homepath/27960/
└── baseq3
├── access.txt
@Nakilon
Nakilon / Nakilon_1.txt
Last active Jul 24, 2018
COLOBOT: Code battle - vs computer :: this one by Nakilon is very short and defeats AI
View Nakilon_1.txt
void titanium() {
object o;
while (null == (o = radar(TitaniumOre, 0, 360, 0, 30))) wait(0.1);
goto(o.position);
grab();
goto(radar(Converter, 0, 360, 0, 20).position);
drop();
move(-2);
}
@Nakilon
Nakilon / news.md
Last active May 6, 2018
Changes in Ruby versions that are the most important for me (comments https://www.reddit.com/r/ruby/comments/8233et/so_ive_updated_my_macos_and_now_switching_from/)
View news.md

N -- new feature -- I may consider using it
B -- breaking change -- I should review my code

https://github.com/ruby/ruby/blob/ruby_2_1/NEWS

N def-expr now returns the symbol of its name instead of nil.
N Array#to_h converts an array of key-value pairs into a Hash.
N Enumerable#to_h converts a list of key-value pairs into a Hash.
N Binding#local_variable_get(symbol)
N Exception#cause provides the previous exception which has been caught at where raising the new exception.
@Nakilon
Nakilon / 1.1.bfn
Created Dec 9, 2017
adventofcode.com/2017/day/1 (Part 1) in Befunge, 61 chars
View 1.1.bfn
~:00pv<@.$>#$<
5:~::<|-5-
\68*-+ v$\_
v0g00$<> #-
>\00p\00g:|
@Nakilon
Nakilon / autoexec.cfg
Last active Nov 3, 2017
CS:GO dedicated server
View autoexec.cfg
log on
hostname "Nakilon CS:GO old de_dust2 Dedicated Server"
rcon_password *****
host_info_show 2
host_players_show 2
exec banned_user.cfg
exec banned_ip.cfg
View logging_with_labels.rb
Google::Cloud::Logging::Logger.class_eval do
%i{ debug info warn error }.each do |level|
old = instance_method level
define_method level do |message, entry_labels = {}, &block|
logger_labels = @labels if @labels
begin
@labels = (@labels || {}).merge entry_labels
old.bind(self).(message, &block)
ensure
@Nakilon
Nakilon / example.rb
Created Jun 13, 2017
Simplified example of using google-cloud-monitoring to store custom metrics of my daemons RAM/fd leakage
View example.rb
require "google/cloud/monitoring/v3/metric_service_client"
client = Google::Cloud::Monitoring::V3::MetricServiceClient.new
project_path = Google::Cloud::Monitoring::V3::MetricServiceClient.project_path JSON.load(File.read ENV["GOOGLE_APPLICATION_CREDENTIALS"])["project_id"]
create_custom_gauge_metric = lambda do |type, display_name, value_type, labels = {}|
metric_descriptor = Google::Api::MetricDescriptor.new( # googleapis-common-protos-1.3.5/lib/google/api/metric_pb.rb
type: "custom.googleapis.com/#{type}",
metric_kind: :GAUGE, # google-cloud-monitoring-0.24.0/lib/google/cloud/monitoring/v3/doc/google/api/metric.rb
value_type: value_type, # google-cloud-monitoring-0.24.0/lib/google/cloud/monitoring/v3/doc/google/api/metric.rb
display_name: display_name,
@Nakilon
Nakilon / google_vision.rb
Last active Nov 19, 2016
snippets about Google Vision usage (for DevFest Siberia 2016)
View google_vision.rb
ENV["GCLOUD_KEYFILE"] = "./key.json"
require "gcloud"
GV = Gcloud.new("my_app").vision
GV.annotate(
GV.image("./google_vision/temp.jpg"),
labels: true,
).gapi.to_h
@Nakilon
Nakilon / plus_vs_minus.rb
Last active Nov 2, 2016
the most straight code perfomance comparison ever, lol
View plus_vs_minus.rb
# either run it in irb or .join some thread to prevent program exit
i = 0
Thread.new do
puts i while sleep 1
end
Thread.new do
loop{ i += 1 }
end
You can’t perform that action at this time.