Skip to content

Instantly share code, notes, and snippets.

View vlymar's full-sized avatar

Victor Lymar vlymar

View GitHub Profile
@vlymar
vlymar / main.go
Created June 3, 2022 17:49
Simple repro of vscode renaming bug
package main
type doer interface {
do() // try "Rename Symbol" on me
}
type coolDoer struct{}
func (d coolDoer) do() {}

Keybase proof

I hereby claim:

  • I am vlymar on github.
  • I am vlymar (https://keybase.io/vlymar) on keybase.
  • I have a public key ASAEAYJW6VbEXHpd0Lwd7165_7BwIodGPhXctIAW5Vkf_wo

To claim this, I am signing this object:

@vlymar
vlymar / ddos_11_9_15_notes.md
Created November 14, 2016 17:32
11/9/15 DOS Attack access.log investigation

number of lines in logfile (aka num requests)

$ wc -l access.log 376359 access.log

first line of logfile

$ head -n1 access.log 172.31.16.226 - - [07/Nov/2016:00:00:02 +0000] "GET /d3bt6306j428ad.cloudfront.net/assets/embedded-ac9659c5db13c873c87adade48e8ce4ef71dd7532f860dec198757b3f8622d7e.css HTTP/1.1" 301 0 "https://screendoor.dobt.co/d3bt6306j428ad.cloudfront.net/assets" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

last line of logfile

$ tail -n1 access.log

@vlymar
vlymar / .githelpers
Created November 4, 2016 19:02
.githelpers
#!/bin/bash
# Stolen from the awesome GRB
# https://github.com/garybernhardt/dotfiles/blob/master/.githelpers
# Log output:
#
# * 51c333e (12 days) <Gary Bernhardt> add vim-eunuch
#
# The time massaging regexes start with ^[^<]* because that ensures that they
# only operate before the first "<". That "<" will be the beginning of the
@vlymar
vlymar / .irbrc
Created September 29, 2016 22:27
.irbrc for pry everywhere
begin
require "pry"
Pry.start
exit
rescue LoadError => e
warn "=> Unable to load pry"
end
@vlymar
vlymar / fzf_dope.sh
Created March 28, 2016 17:12
git fzf multi-add modified files
# fuzzy multi-select modified file
gfmod() {
git ls-files -m | fzf -m
}
# stage files multi-selected modified files
gfadd() {
git add $(gfmod)
}
def outer
y = "penguins"
inner = lambda do
print x
end
x = "dogs"
inner.call
{
"response": {
"version": "0.1",
"termsofService": "http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"geolookup": 1
}
},
"location": {
"type": "CITY",
# enumerate at most 20 objects with the given prefix
bucket.objects.with_prefix('photos/').each(:limit => 20).each do |photo|
puts photo.key
end
@vlymar
vlymar / gist:1726840
Created February 3, 2012 01:00
isLeapYear
/** Checks whether the given year is a leap year.
* @return true if and only if the input year is a leap year.
*/
public static boolean isLeapYear(int year) {
if(year % 400 == 0) {
return true;
} else if(year % 100 == 0) {
return false;
} else if(year % 4 == 0) {
return true;