Skip to content

Instantly share code, notes, and snippets.

@Cambero
Cambero / tmux-cheatsheet.markdown
Created March 19, 2023 20:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Cambero
Cambero / AuthyToOtherAuthenticator.md
Created March 17, 2023 08:24 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@Cambero
Cambero / twitter.rb
Created May 8, 2022 07:53 — forked from michaelminter/twitter.rb
How to use watir-webdriver
#!/usr/bin/ruby
require 'rubygems'
require 'watir-webdriver'
o = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten
string = (0...8).map{ o[rand(o.length)] }.join
# settings
username = "[email protected]"
password = "password"
@Cambero
Cambero / capybara cheat sheet
Created April 29, 2022 09:07 — 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')
@Cambero
Cambero / list.html
Created December 14, 2021 15:35 — forked from ayamomiji/list.html
Stimulus example: smart scroll
<div data-controller="smart-scroll"
data-action="smart-scroll:added->smart-scroll#handleAdded
resize->smart-scroll#handleAdded
scroll->smart-scroll#handleScroll">
<div data-controller="smart-scroll-item">
aya: an an
</div>
<div data-controller="smart-scroll-item">
hatate: ni hao
</div>
@Cambero
Cambero / security.conf
Created November 24, 2021 17:17 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@Cambero
Cambero / node-rails-action-cable-passenger-nginx-virtual-host.conf
Created November 10, 2021 12:32 — forked from bangbay/node-rails-action-cable-passenger-nginx-virtual-host.conf
Nginx virtual host settings for Ruby on Rails API/Action Cable and Node.js front-end Passenger apps on same domain
worker_processes 4; # Set to what your server can handle
events {
worker_connections 1024; # Set to what your server can handle
use epoll;
multi_accept on;
}
http {
include mime.types;
@Cambero
Cambero / omniauth_dynamic_setup.md
Created October 8, 2021 10:50 — forked from jiggneshhgohel/omniauth_dynamic_setup.md
Omniauth Dynamic Setup Custom Params Custom Callback

/config/initializers/omniauth.rb

def provider_facebook
  'facebook'
end

def facebook_opts
  my_model_obj = MyModelService.find_by_provider_name(provider_facebook)
@Cambero
Cambero / gist:1fb77c91e20bb9bbf75473e81d13ae18
Created October 7, 2021 17:41 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: