Skip to content

Instantly share code, notes, and snippets.

View jonataswalker's full-sized avatar
💭
I may be slow to respond.

Jonatas Walker jonataswalker

💭
I may be slow to respond.
View GitHub Profile

#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 20:46 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.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);

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 October 7, 2019 20:39 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

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 August 1, 2019 16:54 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
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 July 5, 2019 12:33
Bl.ocks.org example
<!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 June 12, 2019 13:05 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@jonataswalker
jonataswalker / flat-object.js
Created July 7, 2017 12:39
Get Flat Object
// Turns
{
inputQueryId: 'gcd-input-query',
cssClasses: {
namespace: 'ol-geocoder',
spin: 'gcd-pseudo-rotate'
glass: {
container: 'gcd-gl-container'
}
}
@jonataswalker
jonataswalker / custom
Created April 17, 2017 11:15 — forked from zoqaeski/custom
xkbcomp keyboard layout dump
// $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 April 13, 2017 12:05 — forked from utahta/nginx.conf
nginx + php-fpm + reverse proxy
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}