Skip to content

Instantly share code, notes, and snippets.

View sevenmaxis's full-sized avatar

Serhii Hopkalo sevenmaxis

  • Intetics
  • Ukraine, Kiev
View GitHub Profile
@sevenmaxis
sevenmaxis / Docker.rb
Last active January 9, 2019 15:44
Manjaro setup
######## DOCKER ###########################
# run docker image with interactive bash
docker run -it <sha_image> bash
# run docker image with mounted directory
docker run -it --mount type=bind,source="$(pwd)"/dir1,target=/dir2 <sha_image> bash
docker run -d -v ~/dir1:/var/dir2 -p 5000:80 <sha_image>
docker run -it -v "$(pwd)"/pry:/pry <sha_image> bash
# Launch the container
docker container start <sha_container>
# Enter running container
@sevenmaxis
sevenmaxis / task.rb
Last active February 25, 2018 11:54
Aunt Sue
description = {
children: 3,
cats: 7,
samoyeds: 2,
pomeranians: 3,
akitas: 0,
vizslas: 0,
goldfish: 5,
trees: 3,
import { iconNode } from 'discourse/helpers/fa-icon';
import { addDecorator } from 'discourse/widgets/post-cooked';
import ComposerEditor from 'discourse/components/composer-editor';
import { addButton } from 'discourse/widgets/post-menu';
import { includeAttributes } from 'discourse/lib/transform-post';
import { addToolbarCallback } from 'discourse/components/d-editor';
import { addWidgetCleanCallback } from 'discourse/components/mount-widget';
import { createWidget, decorateWidget, changeSetting } from 'discourse/widgets/widget';
import { onPageChange } from 'discourse/lib/page-tracker';
import { preventCloak } from 'discourse/widgets/post-stream';
@sevenmaxis
sevenmaxis / test.ru
Created June 1, 2015 11:00
I have some thoughts about something
Here's my future code
@sevenmaxis
sevenmaxis / Vim
Last active August 29, 2015 14:11 — forked from suchov/Vim
VI
#Move:
b - back + shift
w - word + shift
e - end of the word
$,0,^
{} - paragraph
f - find the word
F - find the word backword
t, T - find and put the cursor before
megas@mps:~/Work/wordstat[production]$ RACK_ENV=test rake ar:migrate:reset
DEPRECATION WARNING: Yajl::HttpStream is going to be removed in 2.0
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.1053s
== CreateUsers: migrated (0.1054s) ===========================================
== CreateKeywordTrees: migrating =============================================
-- create_table(:keyword_trees)
-> 0.0357s
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset=`tput sgr0`
c_user=`tput setaf 2; tput bold`
c_path=`tput setaf 4; tput bold`
c_git_clean=`tput setaf 2`
c_git_dirty=`tput setaf 1`
else
c_reset=
c_user=
c_path=
foreman start
11:18:36 web.1 | started with pid 11064
11:18:36 collector.1 | started with pid 11070
11:18:36 worker.1 | started with pid 11076
11:18:41 web.1 | Puma starting in single mode...
11:18:41 collector.1 | An exception occurred running /home/megas/.rbenv/versions/rbx-2.2.1/gems/bin/sidekiq:
11:18:41 worker.1 | An exception occurred running /home/megas/.rbenv/versions/rbx-2.2.1/gems/bin/sidekiq:
11:18:41 collector.1 |
11:18:41 collector.1 | no such file to load -- singleton (LoadError)
11:18:41 collector.1 |
Puma caught this error: undefined method `=~' for Pathname (NameError)
kernel/common/module.rb:212:in `instance_method'
kernel/common/module.rb:354:in `undef_method'
kernel/bootstrap/array.rb:66:in `each'
kernel/common/module.rb:352:in `undef_method'
kernel/common/constant_scope.rb:99:in `__undef_method__'
/home/megas/.rbenv/versions/rbx-2.2.1/gems/gems/rubysl-pathname-2.0.0/lib/rubysl/pathname/pathname.rb:1042:in `__script__'
/home/megas/.rbenv/versions/rbx-2.2.1/gems/gems/rubysl-pathname-2.0.0/lib/rubysl/pathname/pathname.rb:1041:in `__script__'
kernel/common/code_loader.rb:243:in `require'
kernel/common/kernel.rb:685:in `require_without_backports (require)'
@sevenmaxis
sevenmaxis / _tab.rb
Last active December 26, 2015 18:49
Another version of shared/tab
ul#js-results-tabs.nav.nav-tabs
- get_link = ->(tab) { url_for(:results, :anchor_file, group_id: @group.id, active_tab: tab) }
li class="#{:anchor_file == active ? 'active' : nil}"
- link = active == :tree ? get_link.call(:anchor_file) : '#js-tab-anchorfile'
= link_to tag_icon('list-alt', 'Anchor file'), link, class: "js-tabs-link"
li class="#{:list == active ? 'active' : nil}"
- link = active == :tree ? get_link.call(:list) : '#js-tab-list'