Skip to content

Instantly share code, notes, and snippets.

Celso Bessa celsobessa

View GitHub Profile
View 1. Refactoring - Original.js
var isProxyBased = (/S40[\w]{3,5}Browser|Opera\sMini\//i).test(navigator.userAgent);
if (('querySelector' in document && 'localStorage' in window && 'addEventListener' in window && !isProxyBased) || (isIE > 6 && document.getElementById('js-holepunched'))) {
// do stuff
}
@celsobessa
celsobessa / GoogleHackMasterList.txt
Created Jan 27, 2020 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
View GoogleHackMasterList.txt
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www” domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
@celsobessa
celsobessa / wow-tooltip-legacy.0.3.0.js
Last active Dec 1, 2019
WoW Pure CSS Tooltip: an experiment fo pure CSS tooltip on anchor elements
View wow-tooltip-legacy.0.3.0.js
/*!
* WoW Pure CSS Tooltip: an experiment fo pure CSS tooltip on anchor elements.
*
* This script sets the `aria-label` attribute on all anchors if it's not set or empty.
* It uses the contents of the `title` attribute, if present, and remove the title
* attribute in order to avoid the browser native tooltip.
* Meant to be used with the companion WoW Pure CSS Tooltip styles.
*
* See: https://gist.github.com/celsobessa/c98e45d2074be5cd915febfed37feeda
* (c) 2019 Celso Bessa, MIT License, https://www.celsobessa.com.br
@celsobessa
celsobessa / .bashrc
Created Nov 29, 2019
show git branch on your terminal prompt for unix like systems (unix, linux, macOs)
View .bashrc
# Add this to ~/.bashrc
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="[\u@\h \W]\$(git_branch)\$ "
@celsobessa
celsobessa / multiple_ssh_setting.md
Created Nov 2, 2019 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@celsobessa
celsobessa / shrinkpdf.sh
Created Jul 19, 2019 — forked from cbessadejusticia/shrinkpdf.sh
shrinkpdf.sh script by Alfred Klomp for optimizing (shrinking) PDF files using Ghostscript
View shrinkpdf.sh
#!/bin/sh
# http://www.alfredklomp.com/programming/shrinkpdf
# Licensed under the 3-clause BSD license:
#
# Copyright (c) 2014, Alfred Klomp
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@celsobessa
celsobessa / sleep-es6.js
Created Jun 14, 2019
sleep() equivalent for vanilla Javascript using ES6 features
View sleep-es6.js
// sleep() equivalent for vanilla Javascript using ES6 features
// created by Dan Dascalescu
// see https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep/39914235#39914235
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function demo() {
console.log('Taking a break...');
@celsobessa
celsobessa / parseUri.1.2.2.js
Created Jun 4, 2019
parseUri 1.2.2 by Steven Levithan
View parseUri.1.2.2.js
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
@celsobessa
celsobessa / isEmpty.js
Last active May 29, 2019
isEmpty, a javascript helper for checking if objects are empty.
View isEmpty.js
// check all properites in a object as explained by Viktor Borisov on
// https://firstclassjs.com/check-if-object-is-empty-in-javascript/
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) return false;
}
return true;
}
// use Examples
@celsobessa
celsobessa / .gitignore
Last active Jun 18, 2019 — forked from salcode/.gitignore
a fork of salcode .gitignore file for a general web project - Bare Minimum Git
View .gitignore
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20181206
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/celsobessa/67e02d08bf89ada501e7ea8531cc0624/raw/a6a4ff4cd71112a566ed893846dd4ab8d14035c0/.gitignore
# to download this file
#
You can’t perform that action at this time.