Skip to content

Instantly share code, notes, and snippets.

View sizief's full-sized avatar

Ali Deishidi sizief

View GitHub Profile
#!/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'
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
rake build
gem install pkg/subfinder-0.0.1.gem
gem push pkg/subfinder-0.0.1.gem
alias dps="docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND: {{.Command}}\nCREATED: {{.CreatedAt}}\nSTATUS: {{.Status}}\nPORTS: {{.Ports}}\nNAMES: {{.Names}}\n'"
# 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
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
"Save file, clean screen and run ruby file
map <leader>\ :w<cr>:!printf "\033c"<cr>:!ruby %<cr>