Skip to content

Instantly share code, notes, and snippets.

View askamiroff's full-sized avatar
💣

Askar A askamiroff

💣
  • Russia, Kazan
View GitHub Profile
@askamiroff
askamiroff / linux-power-management
Created March 7, 2021 19:09 — forked from mohammedmatar/linux-power-management
Power management configs for Arch Linux (without laptop-mode-tools, powertop, etc)
## Preamble
There are lots of tools out there that set power management, some more transparent (powertop), some less so (laptop-mode). Often it is hard to know what exactly the tool is doing to improvement power management. Here I would like to document some of the things I do to improve power efficiency and sometimes performance as well.
/etc/sysctl.d/99-sysctl.conf
> # To fix Dropbox not being able to handle too many files
> fs.inotify.max_user_watches = 524288
>
> # VM writeback timeout (suggestion from powertop: In hundredths of a second, this is how often pdflush wakes up to write data to disk.)
> vm.dirty_writeback_centisecs = 1500
/**
* Event loop.
*
* Read details here:
* http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition/#job
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
/**
/**
* Filter object properties.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style license, 2019
*/
const filterProps = (
[p1, p2, p3],
{
/**
* Async iterators simple example.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style License, 2018
*/
async function* streamChunks() {
yield genChunk(1);
yield genChunk(2);
# Helpers
def git_update(message)
git :add => ".", :commit => "-m '#{message}'"
end
def git_remove(file)
git :rm => file
end
@askamiroff
askamiroff / Capistrano 3.md
Created May 12, 2016 20:20 — forked from stevenyap/Capistrano 3.md
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
@askamiroff
askamiroff / bashrc
Created May 12, 2016 19:56 — forked from mislav/bashrc
Basic vimrc and tmux config for servers
PS1='\[\033[31m\]\w\[\033[0m\] $ '
export EDITOR=vim
alias st='git status -sb'
@askamiroff
askamiroff / Capybara.md
Created May 12, 2016 09:50 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@askamiroff
askamiroff / capybara cheat sheet
Created May 12, 2016 09:50 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@askamiroff
askamiroff / alias_matchers.md
Created May 12, 2016 09:17 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value