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 array-cheat-sheet.md

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active Sep 16, 2021
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

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@cweinberger
cweinberger / mysql-drop-all-tables.sh
Created Jun 6, 2018
drops all tables of a specific db
View mysql-drop-all-tables.sh
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@justsml
justsml / fetch-api-examples.md
Last active Sep 2, 2021
JavaScript Fetch API Examples
View fetch-api-examples.md
@petronetto
petronetto / Dockerfile
Created Oct 10, 2017
Alpine PHP 7 with everything that you need
View Dockerfile
FROM alpine:3.6
LABEL maintainer="juliano@petronetto.com.br"
ENV PHP_VERSION=7.1.9-r0 \
IGBINARY_VERSION=2.0.4 \
PHP_MEMCACHED_VERSION=3.0.3 \
PHPREDIS_VERSION=3.1.4 \
PHP_AMQP_VERSION=1.9.0 \
MONGO_PHP_DRIVER_VERSION=1.1.10
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active Sep 17, 2021
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.
View S3-Static-Sites.md

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@dianjuar
dianjuar / android_on_arch.md
Created Apr 10, 2017
install android SDK on arch linix
View android_on_arch.md

Install Android SDK on Arch Linux

1. Download Android SDK on your computer

yaourt android-sdk-platform-tools
yaourt android-udev
yaourt android-sdk

2. Create global variables on system

@tamas-molnar
tamas-molnar / kubectl-shortcuts.sh
Last active Sep 4, 2021
aliases and shortcuts for kubectl
View kubectl-shortcuts.sh
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@vlucas
vlucas / encryption.js
Last active Sep 1, 2021
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 please-include-a-repro.md

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Node versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and I