This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# see here for more info https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/ | |
# uncomment --output-path tosave output | |
# to send data periodically only one run `wheneverize .` and then | |
# `whenever --update-crontab` You can set time period changin `config/schedule.rb` | |
require 'json' | |
require 'rubygems' | |
require 'dogapi' | |
require 'dotenv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Development | |
- $ npm init -y | |
- $ npm install nodemon --save-dev | |
- $ npm install @babel/core @babel/cli @babel/node @babel/preset-env --save-dev | |
- `.babelrc` -> `{"presets": ["@babel/preset-env"]}` | |
- `package.json` -> `"scripts": {"build":"babel src -d dist"}` | |
- `package.json` -> `"scripts": {"start":"nodemon --exec babel-node src/file.js"}` | |
or following line is the same. But note that following line is NOT restart the the output based on code changes. | |
- `package.json` -> `"start": "npm run build && nodemon dist/todo_store.js"` | |
- $ npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake build | |
gem install pkg/subfinder-0.0.1.gem | |
gem push pkg/subfinder-0.0.1.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias dps="docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND: {{.Command}}\nCREATED: {{.CreatedAt}}\nSTATUS: {{.Status}}\nPORTS: {{.Ports}}\nNAMES: {{.Names}}\n'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# decompress | |
tar zxvf | |
# Ruby | |
https://stackoverflow.com/questions/37720892/you-dont-have-write-permissions-for-the-var-lib-gems-2-3-0-directory | |
# Ruby dev | |
apt-get install ruby`ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]'`-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
class ArrayTest < Minitest::Test | |
def test_simple_array | |
assert [[1,2,[3]],4].flattify == [1,2,3,4] | |
assert [1,2,[3],4].flattify == [1,2,3,4] | |
assert [[[1],[2]],3,[4]].flattify == [1,2,3,4] | |
assert [['a'],4].flattify == ['a',4] | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Save file, clean screen and run ruby file | |
map <leader>\ :w<cr>:!printf "\033c"<cr>:!ruby %<cr> |