Skip to content

Instantly share code, notes, and snippets.

View celsobessa's full-sized avatar

Celso Bessa celsobessa

View GitHub Profile
@celsobessa
celsobessa / trap_focus.js
Created June 5, 2021 20:39 — forked from myogeshchavan97/trap_focus.js
Code for trapping focus inside modal
// add all the elements inside modal which you want to make focusable
const focusableElements =
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
const modal = document.querySelector('#exampleModal'); // select the modal by it's id
const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal
const focusableContent = modal.querySelectorAll(focusableElements);
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
@celsobessa
celsobessa / Links
Created June 5, 2021 20:41 — forked from lukecav/Links
Speed Up Your WordPress Site with These 3 Advanced Techniques Workshop - WordSesh 2021
@celsobessa
celsobessa / bandwidth.js
Last active June 25, 2021 14:58 — forked from debloper/bandwidth.js
Determine client's connection speed with JavaScript
// Let's initialize the primitives
var startTime, endTime, fileSize, result, unit = {kbps:1,kBps:8};
// Set up the AJAX to perform
var xhr = new XMLHttpRequest();
// Rig the call-back... THE important part
xhr.onreadystatechange = function () {
// we only need to know when the request has completed
@celsobessa
celsobessa / GoogleDorking.md
Created June 27, 2021 00:47 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@celsobessa
celsobessa / google-dorks
Created June 27, 2021 01:10 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@celsobessa
celsobessa / nvmCommands.js
Created June 29, 2021 03:43 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
#!/bin/bash
# Do not forget to run `chmod +x ./open-list-of-urls-macos.sh` in order
# to make your script executable
# after that type `./open-list-of-urls-macos.sh ./text-file-with-list-of-urls.extension`
# you will need to change `./open-list-of-urls-macos.sh` to the location of your script
# and `./text-file-with-list-of-urls.extension` to the location of your url list.
# For example:
# `./tools/open-list-of-urls-macos.sh ./misc/text-file-with-list-of-urls.txt`
FILE=$1
while read LINE; do

POSIX commands Cheatsheat

  • admin - create and administer SCCS files (DEVELOPMENT)
  • alias - define or display aliases
  • ar - create and maintain library archives
  • asa - interpret carriage-control characters
  • at - execute commands at a later time
  • awk - pattern scanning and processing language
  • basename - return non-directory portion of a pathname
  • batch - schedule commands to be executed in a batch queue
@celsobessa
celsobessa / operadores-separadores-de-comandos-shell-es-co.md
Last active September 24, 2021 23:03
Shell's command operators / separators (en-us) ; Operadores / separadores de comando do Shell (pt-br;es-co)
@celsobessa
celsobessa / uggliest-html-markup-ever-candidate-01.html
Last active October 23, 2021 19:43
The uggliest HTML markups ever
<!--
source: https://www.minsalud.gov.co/proteccionsocial/promocion-social/Discapacidad/Paginas/discapacidad.aspx
archived at: https://web.archive.org/web/20211023194143/https://www.minsalud.gov.co/proteccionsocial/promocion-social/Discapacidad/Paginas/discapacidad.aspx
-->
<h1 id="pageTitle" class="ms-core-pageTitle">
<span id="DeltaPlaceHolderPageTitleInTitleArea">
Discapacidad