Skip to content

Instantly share code, notes, and snippets.

@albovieira
albovieira / copy_push_icons
Created September 11, 2017 19:35
Hook to add push icons with his respective size to android folder
//add this in: /hooks/before_prepare
var chalk = require('chalk');
var exec = require('child_process').exec;
exports.run = copyPushIcon;
function copyPushIcon() {
var rootdir = process.argv[2] + '/resources/android/push_icons/';
@albovieira
albovieira / loop_request.sh
Created September 22, 2017 20:18
loop_request
#!/bin/sh
count=0
url='http://165.227.125.140:8000/api/v1/events/?format=json&limit=6'
while [ $count -lt 1000000 ]
do
curl -X GET \
$url \
-H 'cache-control: no-cache' \
@albovieira
albovieira / for.sh
Created September 22, 2017 20:20
for.sh
#!/bin/sh
NUMS="1 2 3 4 5 6 7"
for NUM in $NUMS
do
Q=`expr $NUM % 2`
if [ $Q -eq 0 ]
then
echo "Number is an even number!!"
@albovieira
albovieira / mods-febraban.js
Last active March 9, 2018 23:05
Mod10 - Febraban
import _ from 'lodash';
function calculateDV(barcode) {
let brokeParts = _.chunk(barcode, 11);
if (barcode.startsWith(8)) {
return brokeParts
.map(i => {
let part = i.join('');
console.log(part);
FROM node:8.9.2
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN apt-get update && apt-get install vim -y && npm install -g yarn typescript nodemon && yarn
COPY . /usr/src/app
EXPOSE 3000
CMD [ "yarn", "dev" ]
@albovieira
albovieira / NODE-docker-compose.yml
Created July 6, 2018 02:10
Env - mongo + pg + redis + node
version: "2"
services:
app:
container_name: app
build: .
volumes:
- .:/app
ports:
- "3000:3000"
networks:
#!/bin/sh
a=0
while [ $a -lt 100000 ]
do
curl -X POST \
http://localhost:3000/auth/login \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: d268322e-137b-485d-9cc8-ae1af3121a0b' \
const CLOUD_MESSAGER = {
android: {
messager: 'GCM',
arn: process.env.AWS_SNS_ANDROID_ARN
},
ios: {
messager: 'APNS',
arn: process.env.AWS_SNS_IOS_ARN
}
};
This file has been truncated, but you can view the full file.
{
"-LLakloTgTIcJE4Zqody": {
"data": {
"code": "4000",
"message": "User not found",
"type": "ResourceNotFoundException"
},
"provider": "maxmilhas",
"status": 404,
"user": "felipearimm"
sudo nmcli connection import type openvpn file /home/albo-vieira/Downloads/client.ovpn
sudo openvpn --config ~/Downloads/client.ovpn