Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Jonatas Walker jonataswalker

I may be slow to respond.
  • Campinas, Brasil
View GitHub Profile
jonataswalker / build-tree-from-directory.php
Last active May 23, 2021
Build a tree (array or json) from any directory.
View build-tree-from-directory.php
* Public Domain.
* @author Jonatas Walker
* Based in:
* Usage:
* $root = '/home/www/';
* $allow_ext = array('jpg','gif');
* $exclude_dir = array('tilemill');
* $prefix = 'small';
jonataswalker / codility_solutions.txt
Created May 21, 2016 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
View codility_solutions.txt
Lesson 1 - Iterations
- BinaryGap -
Lesson 2 - Arrays
- OddOccurrencesInArray -
- CyclicRotation -
Lesson 3 - Time Complexity
- FrogJmp -
- PermMissingElem -

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

View Inject javascript into HTML pages from

#Inject javascript into HTML pages from console

An easy way to inject Javascripts into the current loaded dom using the developer console in chrome.


var script = document.createElement('script');
script.src = '';
jonataswalker / encryption.js
Created May 1, 2020 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
View encryption.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
View Oh my zsh with autosuggestions &

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
jonataswalker / my-mailer.js
Last active Feb 16, 2020
Sending mail with Gmail (XOAuth2) and Nodemailer
View my-mailer.js
'use strict';
var xoauth2 = require('xoauth2');
var nodemailer = require('nodemailer');
var smtp = require('nodemailer-smtp-transport');
var htmlToText = require('nodemailer-html-to-text').htmlToText;
// Sending mail with Gmail using XOAuth2
jonataswalker / nginx.conf
Created Apr 13, 2017 — forked from utahta/nginx.conf
nginx + php-fpm + reverse proxy
View nginx.conf
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/;
events {
worker_connections 1024;
jonataswalker /
Created Oct 7, 2019 — forked from mrk-han/
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER


  • The goal of this gist is to quickly pre-install a range of system images to provide our project teams the ability to run emulators on a range of API levels, from API 19 to API 28.
    • These can be run locally or on the base build agent.
  • Note: X86 is the fastest architecture for emulators, though x86_64 would probably be better to test against because most phones are 64 bit now.
  • We create two sets of emulators here, one set with pixel hardware emulation and one set with default oem emulation.

See: Google Documentation on Start the emulator from the command line for more info

jonataswalker / sed cheatsheet
Created Aug 1, 2019 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'