Skip to content

Instantly share code, notes, and snippets.

View davidsonsns's full-sized avatar
🎯
Focusing

Davidson Nascimento davidsonsns

🎯
Focusing
  • San Diego, CA
View GitHub Profile
@davidsonsns
davidsonsns / whatsapp_phone_enumerator_floated_div.js
Created July 14, 2017 10:43
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses (floated div)
/****** I've created a Chrome extension from this script, take a look at https://github.com/LoranKloeze/WhatsAllApp ********/
/*
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses
Floated div edition
01-05-2017
(c) 2017 - Loran Kloeze - loran@ralon.nl
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds
of information from a range of phonenumbers. It doesn't matter if these numbers are part
function draftToText(obj) {
return new Promise((resolve, reject) => {
try {
const draftObj = typeof obj === 'string' ? JSON.parse(obj) : obj;
const completText = [];
for (let index = 0; index < draftObj.blocks.length; index++) {
completText.push(obj.blocks[index].text.trim());
}
resolve(completText.join(' '));
} catch (error) {
@davidsonsns
davidsonsns / NotificationSequence
Last active July 20, 2017 17:49
HTML 5 Notification in sequence
function NotificationSequence() {
const notifications = []
const showNotifications = (notification) => {
Notification.requestPermission(function (permission) {
const n = new Notification(notification.title, notification)
setTimeout(() => {
n.close()
notifications.pop()
if (notifications.length) {
showNotifications(notifications[notifications.length - 1])
@davidsonsns
davidsonsns / git-update-fork.sh
Created October 24, 2017 00:02 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@davidsonsns
davidsonsns / gitflow-breakdown.md
Created December 5, 2017 11:36 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@davidsonsns
davidsonsns / mongo_backup.sh
Created December 5, 2017 17:39 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@davidsonsns
davidsonsns / localtunnel-forever.js
Created March 11, 2018 11:49
run localtunnel forever
const localtunnel = require('localtunnel')
const tunels = [{
subdomain: 'youDomain',
local_host: 'localhost',
port: 4000,
}, {
subdomain: 'youDomain',
local_host: 'localhost',
port: 3000,
@davidsonsns
davidsonsns / requireAll.js
Last active June 1, 2018 15:50
Require every file in a directory
/**
* Baseaded in this issue
* @link https://github.com/webpack/webpack/issues/625
*/
import set from 'lodash/set';
import trimStart from 'lodash/trimStart';
const context = require.context('src/assets');
const obj = {};
context.keys().forEach(function(key) {
@davidsonsns
davidsonsns / better-nodejs-require-paths.md
Created August 1, 2018 13:50 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@davidsonsns
davidsonsns / iterm2-solarized.md
Created October 26, 2019 15:06 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k