Skip to content

Instantly share code, notes, and snippets.

View caiquecastro's full-sized avatar
🎯
Focusing

Caíque de Castro Soares da Silva caiquecastro

🎯
Focusing
View GitHub Profile
@caiquecastro
caiquecastro / FinancesTable.tsx
Last active July 15, 2022 15:20
Venturus 4Tech
import type { NextPage } from "next";
import { useEffect, useState } from "react";
import {
Table,
Thead,
Tbody,
Tr,
Th,
Td,
TableContainer,
@caiquecastro
caiquecastro / .docker_aliases
Created July 14, 2018 16:46
.docker_aliases
#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'
@caiquecastro
caiquecastro / sort.sh
Last active December 9, 2016 13:32
Sort on shell
#!/usr/bin/env sh
# Prints a random line from a file
# Script by @augustohp
lines_on() {
file=$1
wc -l $file | awk '{print $1}'
}
random_until() {
max=$1
@caiquecastro
caiquecastro / thread.php
Created November 7, 2016 13:48
PHP tem thread
<?php
class SimpleWorkerThread extends Thread
{
private $workerId = 0;
public function __construct($id)
{
$this->workerId = $id;
}
@caiquecastro
caiquecastro / composer.json
Created September 21, 2016 13:52
TOTP library for PHP
{
"name": "caique/otp",
"authors": [
{
"name": "Caique de Castro",
"email": "[email protected]"
}
],
"require": {
"rych/otp": "^1.1",
@caiquecastro
caiquecastro / USAGE.md
Last active January 26, 2018 12:52
Commiters share

Usage

Change file permission:

chmod +x commiters-share.php

Move the scripts to your bin folder:

cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
#!/bin/bash
while ! ping -n -c 1 8.8.8.8
do
sleep 10
done
echo "network is working"
#! /bin/bash
set -eou pipefail
#usage: sudo ./docker-cleanup-volumes.sh [--dry-run]
docker_bin=$(which docker.io 2> /dev/null || which docker 2> /dev/null)
# Default dir
dockerdir=/var/lib/docker
#!/bin/bash
# Make sure that all text is parsed in the same language
export LC_MESSAGES=en_US.UTF-8
export LC_COLLATE=en_US.UTF-8
export LANG=en_US.utf8
export LANGUAGE=en_US:en
export LC_CTYPE=en_US.UTF-8
# Calculate how much memory and swap is free