Skip to content

Instantly share code, notes, and snippets.

View fernyb's full-sized avatar

Fernando Barajas fernyb

View GitHub Profile
@fernyb
fernyb / gist:3e3f541836f24b1a48a3b567a6a66794
Created March 28, 2021 17:53
remove docker containers
docker container ls --all | grep "minutes ago" | awk '{ print $1 }' | xargs docker container rm $1
@fernyb
fernyb / cypress-promises.js
Created March 22, 2021 18:05
Cypress Promises
const throwsAnError = function(message) {
return new Cypress.Promise((resolve, reject) => {
setTimeout(() => {
//throw "Emergency! Emergency!"
resolve(message);
//reject("All American Rejects!");
}, 3500);
});
}
#!/usr/bin/env node
(() => {
function makeHttpRequests() {
let newCount = 0;
let a = new Promise((resolve) => {
setTimeout(function() {
resolve(newCount += 1);
}, Math.floor(Math.random() * 10) * 2000);
@fernyb
fernyb / gist:9c07e778e252ce6ff54c351205f6da99
Last active March 15, 2021 16:01
vscode settings.json vim comment block
{
"editor.tabSize": 2,
"workbench.colorTheme": "Moonlight II",
"editor.lineNumbers": "relative",
"editor.renderLineHighlight": "all",
"editor.minimap.enabled": false,
"vim.commandLineModeKeyBindings": [
],
"vim.leader": "\\",
"vim.normalModeKeyBindings": [
# entrypoint is the default /bin/sh -c
# /bin/sh -c bash
docker run -i -t pup bash
# Build docker image
docker build -t pup .
# remove dangling images
docker image prune
Cool app to visialize git. Good to practice and get a visual understanding of what is happening.
https://git-school.github.io/visualizing-git/#free
@fernyb
fernyb / gist:4ac00688b74abfb994cdbeca9b5521f7
Created January 14, 2021 04:26
Set default remote for git push
# Set the default remote
git push -u <remote_name> <local_branch_name>
# Do git push to push to the default remote from above
git push
# To push to a differente remote other than the default
git push <new_remote_name> <branch_name>
@fernyb
fernyb / gist:bbd3090c56f0679608204ca45d179809
Last active December 26, 2020 02:33
npm install -g .
# Install the local bin command when developing a package
npm install -g .
# To uninstall
npm uninstall -g pup
npm uninstall -g .
// ==UserScript==
// @name Do a search
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Simple Search
// @author You
// @match https://www.yellowpages.com*
// @grant none
// ==/UserScript==
@fernyb
fernyb / frida-android-repinning_sa-1.js
Last active September 16, 2019 21:47
Android SSL Re-pinning frida script
/*
Android SSL Re-pinning frida script v0.2 030417-pier
$ adb push burpca-cert-der.crt /data/local/tmp/cert-der.crt
$ frida -U -f it.app.mobile -l frida-android-repinning.js --no-pause
https://techblog.mediaservice.net/2017/07/universal-android-ssl-pinning-bypass-with-frida/
*/
setTimeout(function(){