Skip to content

Instantly share code, notes, and snippets.

View thesunwave's full-sized avatar
🏠
Working from home

Artur Malev thesunwave

🏠
Working from home
View GitHub Profile
@thesunwave
thesunwave / .pryrc
Created December 18, 2020 11:10 — forked from bibendi/.pryrc
Dip on Rails
Pry.config.history.should_save = true
Pry.config.history.file = File.join(__dir__, '.pry_history')
@thesunwave
thesunwave / main.go
Created December 2, 2019 21:08
local files runner on golang
package main
import (
"bytes"
"errors"
"fmt"
"github.com/gin-gonic/gin"
"github.com/parsiya/golnk"
"io/ioutil"
"log"
package main
import (
"flag"
"fmt"
"github.com/loov/hrtime"
"io/ioutil"
"os"
"regexp"
"sort"
@thesunwave
thesunwave / docker-cleanup-resources.md
Created May 21, 2019 11:49 — forked from fpapadopou/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

package main
import (
"encoding/json"
"fmt"
"github.com/gocolly/colly"
"github.com/mb-14/gomarkov"
"io/ioutil"
"strings"
)
Fetching scrypt 2.0.2
Installing scrypt 2.0.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/thesunwave/.rvm/gems/ruby-2.3.5/gems/scrypt-2.0.2/ext/scrypt
/Users/thesunwave/.rvm/rubies/ruby-2.3.5/bin/ruby -rrubygems /Users/thesunwave/.rvm/gems/ruby-2.3.5/gems/rake-10.5.0/bin/rake
RUBYARCHDIR=/Users/thesunwave/.rvm/gems/ruby-2.3.5/extensions/x86_64-darwin-18/2.3.0/scrypt-2.0.2
RUBYLIBDIR=/Users/thesunwave/.rvm/gems/ruby-2.3.5/extensions/x86_64-darwin-18/2.3.0/scrypt-2.0.2
mkdir -p x86_64-darwin
/Users/thesunwave/.rvm/rubies/ruby-2.3.5/bin/ruby -I/Users/thesunwave/.rvm/gems/ruby-2.3.5/gems/ffi-compiler-0.1.3/lib/ffi-compiler/fake_ffi
def sort(str)
arr = str.split(" ")
words = arr.map.with_index do |e, idx|
next if e =~ /-?\d+/
[idx, e]
end.compact
nums = arr.map.with_index do |e, idx|
next unless e =~ /-?[0-9]/
@thesunwave
thesunwave / tmux-iterm2.md
Created November 7, 2017 14:25 — forked from royling/tmux-iterm2.md
tmux in iTerm2 cheatsheet
require 'rest-client'
class YandexGeocoder
attr_reader :data, :address
NotFound = Class.new(StandardError)
EmptyRequest = Class.new(StandardError)
BASE_URL = 'https://geocode-maps.yandex.ru/1.x/'.freeze
PARAMS = {
@thesunwave
thesunwave / rvm.sh
Last active February 14, 2017 11:14 — forked from tesths/rvm.sh
rvm
#fork from https://github.com/huacnlee/init.d
echo "Install RVM"
echo "---------------------------------------------------------------------------"
command gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
command curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.3.3