Skip to content

Instantly share code, notes, and snippets.

@corona6
corona6 / app_net_scraping.rb
Created July 7, 2015 05:53
Web scraping from alpha.app.net trending
require 'capybara'
require 'capybara/poltergeist'
# create session
Capybara.javascript_driver = :poltergeist
options = { js_errors: false, timeout: 180, phantomjs_logger: StringIO.new, logger: nil, phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes'] }
Capybara.register_driver(:poltergeist) do |app|
Capybara::Poltergeist::Driver.new app, options
end
session = Capybara::Session.new(:poltergeist)
@corona6
corona6 / bookmarklet.md
Last active May 31, 2020 11:34
my bookmarklets

Bookmarklet

save

javascript:void function%28%29%7bhref%3dlocation%2ehref%3bvar a%3ddocument%2ecreateElement%28"a"%29%3ba%2ehref%3dhref%3bvar a%3dnew Blob%28%5b%27<base href%3d"%27%2ba%2eprotocol%2b"%2f%2f"%2ba%2ehostname%2b%27">%27%2bdocument%2edocumentElement%2eouterHTML%2b"> "%2blocation%2ehref%5d%29%2ca%3d%28window%2eURL%7c%7cwindow%2ewebkitURL%29%2ecreateObjectURL%28a%29%2cb%3ddocument%2ecreateElement%28"a"%29%3bb%2edownload%3ddocument%2etitle%2b"%2ehtml"%3bb%2ehref%3da%3bb%2eclick%28%29%7d%28%29%3b

copy url as markdown

@corona6
corona6 / README.md
Last active November 15, 2024 15:54
delete unused resources/revisions/tags for Joplin https://github.com/corona6/joplinclean
@corona6
corona6 / appimagekit-keepassxc.desktop
Created May 24, 2019 15:32
~/.local/share/applications
[Desktop Entry]
Name=KeePassXC
Comment=KeePass Cross-Platform Community Edition
Exec="/home/y/AppImage/KeePassXC-2.4.1-x86_64.AppImage" %U
Terminal=false
Type=Application
Icon=/home/y/AppImage/keepassxc.png
TryExec=/home/y/AppImage/KeePassXC-2.4.1-x86_64.AppImage
@corona6
corona6 / config.fish
Created May 28, 2019 04:57
.config/fish/config.fish for Chromebook
set PATH $PATH /home/linuxbrew/.linuxbrew/bin
test $TERM != "screen"; and exec tmux
source ~/.asdf/asdf.fish
alias pbcopy='xclip -selection c'
alias pbpaste='xclip -selection c -o'
@corona6
corona6 / headless_chrome.rb
Created May 28, 2019 05:05
use headless_chrome
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end
Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w[headless disable-gpu] }
@corona6
corona6 / my_tools.md
Last active July 18, 2020 14:53
my tools
@corona6
corona6 / search_query.md
Last active September 10, 2019 18:10
search TODO in joplin

" ] *" ""

Using full-width space.

@corona6
corona6 / userstyle.css
Created October 8, 2019 04:59
.config/joplin-desktop/
body .octicon {
display: inline-block;
fill: currentColor;
vertical-align: text-bottom;
}
body .anchor {
float: left;
line-height: 1;
margin-left: -20px;