Skip to content

Instantly share code, notes, and snippets.

View AlissonEnz's full-sized avatar
🏠
Working from home

Alisson Enz Rossi AlissonEnz

🏠
Working from home
View GitHub Profile
@marklawlor
marklawlor / main.js
Created April 28, 2021 00:07
Moti + Storybook + React-Native-Web
const path = require("path");
const { withUnimodules } = require("@expo/webpack-config/addons");
module.exports = {
stories: ["../src/**/*.stories.@(ts|tsx|js|jsx)"],
webpackFinal: async (config) => {
return withUnimodules(
config,
{
projectRoot: path.resolve(__dirname, "../"),
@akexorcist
akexorcist / index.js
Last active September 13, 2024 19:03
Axios post method requesting with x-www-form-urlencoded content type. See https://axios-http.com/docs/urlencoded
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)
@atinux
atinux / async-foreach.js
Last active August 30, 2024 13:03
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
import FirebaseFirestore
private struct Property {
let label: String
let value: Any
}
struct FirestoreModelData {
let snapshot: DocumentSnapshot
@paladini
paladini / aws-ec2-redis-cli.md
Last active August 14, 2024 13:39 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli