Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Jonatas Walker jonataswalker

💭
I may be slow to respond.
  • Campinas, Brasil
View GitHub Profile
View Inject javascript into HTML pages from console.md

#Inject javascript into HTML pages from console

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

jQuery

var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
@jonataswalker
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 & syntax-highlighting.md

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

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

  • Download zsh-autosuggestions by
@jonataswalker
jonataswalker / emulator-install-using-avdmanager.md
Created Oct 7, 2019 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)
View emulator-install-using-avdmanager.md

Install and Create Emulators using AVDMANAGER and SDKMANAGER

About

  • 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
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
FILE SPACING:
# 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'
@jonataswalker
jonataswalker / index.html
Created Jul 5, 2019
Bl.ocks.org example
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Bl.ocks.org example</title>
</head>
<body>
<h1>Teste</h1>
</body>
@jonataswalker
jonataswalker / introrx.md
Created Jun 12, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
View flat-object.js
// Turns
{
inputQueryId: 'gcd-input-query',
cssClasses: {
namespace: 'ol-geocoder',
spin: 'gcd-pseudo-rotate'
glass: {
container: 'gcd-gl-container'
}
}
@jonataswalker
jonataswalker / custom
Created Apr 17, 2017 — forked from zoqaeski/custom
xkbcomp keyboard layout dump
View custom
// $XDG_CONFIG_HOME/xkb/symbols/custom
// Makes ALT + CAPS_LOCK act as 3rd level switch
// Works sporadically
partial modifier_keys
xkb_symbols "alt_caps_mode_switch" {
key <CAPS> {
type[Group1]="PC_ALT_LEVEL2",
[ Caps_Lock, ISO_Level3_Shift ]
};
@jonataswalker
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/nginx.pid;
events {
worker_connections 1024;
}