Skip to content

Instantly share code, notes, and snippets.

😜
Do what you want

Leopoldo Brines leobrines

😜
Do what you want
Block or report user

Report or block leobrines

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leobrines
leobrines / sed.txt
Last active Dec 2, 2019
Syntax for refactor with new lines and multiple files in Mac OS with sed command
View sed.txt
# Source: https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string
sed -e '1h;2,$H;$!d;g' -e 's/__YOUR_REGEX_GOES_HERE__...'
# Source: https://blog.stathat.com/2012/10/11/refactoring_with_sed.html
sed -i "" 's/uc.User.Data.ApiKey/uc.User.ApiKey()/g' **/*.go
View ngrok-install.sh
#!/bin/bash
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
rm ngrok-stable-linux-amd64.zip
chmod 755 ngrok
mv ngrok /usr/bin/
@leobrines
leobrines / gdrive_install.sh
Created Sep 9, 2019
Bash Script For Install Gdrive
View gdrive_install.sh
#!/bin/bash
gdrive_name=gdrive
gdrive_bin=/usr/bin/$gdrive_name
if [ -f $gdrive_name ] ; then
echo "$gdrive_name already existe, probably it's installed..."
exit 0
else
echo "Downloading Google Drive | Script for Linux x64..."
@leobrines
leobrines / gdrive_install.sh
Created Sep 9, 2019
Bash Script For Install Gdrive
View gdrive_install.sh
#!/bin/bash
gdrive_name=gdrive
gdrive_bin=/usr/bin/$gdrive_name
if [ -f $gdrive_name ] ; then
echo "$gdrive_name already existe, probably it's installed..."
exit 0
else
echo "Downloading Google Drive | Script for Linux x64..."
@leobrines
leobrines / gdrive_install.sh
Created Sep 9, 2019
Bash Script For Install Gdrive
View gdrive_install.sh
#!/bin/bash
gdrive_name=gdrive
gdrive_bin=/usr/bin/$gdrive_name
if [ -f $gdrive_name ] ; then
echo "$gdrive_name already existe, probably it's installed..."
exit 0
else
echo "Downloading Google Drive | Script for Linux x64..."
View markdown.css
.markdown-body {
font-size: 15px;
line-height: 1.7;
overflow: hidden; }
.markdown-body > *:first-child {
margin-top: 0 !important; }
.markdown-body > *:last-child {
margin-bottom: 0 !important; }
.markdown-body a.absent {
color: #c00; }
@leobrines
leobrines / sockets_svq.inc
Created Jun 14, 2019
AMXX CS 1.6 Include - This enable to query a server for it's information like hostname, map or players count with sockets
View sockets_svq.inc
#include <amxmodx>
#include <sockets>
#define MAX_INFO_LEN 1400
#define MAX_INFO_FORMAT 100
// A2S_INFO definitions for source according to http://developer.valvesoftware.com/wiki/Server_Queries#Source_servers_2
#define A2S_INFO "^xFF^xFF^xFF^xFF^x54Source Engine Query^x00"
#define A2S_INFO_LEN 25
@leobrines
leobrines / create-user.js
Created May 18, 2019
Get key from "DuplicateKeyError" MongoDB - NodeJS
View create-user.js
try {
await db.collection('users').create({
name,
email,
phone,
password
})
} catch (error) {
if (error.code == 11000) {
const duplicated = error.match(/index:\s([a-z]+)/i);
View container.example.js
// This file is to register independent modules and dependencies of each entities, usecase, etc.
//
// All this is fiction:
// infrastructure -> External frameworks
// interfaces -> Layer of abstraction of frameworks
//
import serviceLocator from './config/serviceLocator'
serviceLocator.register('webserver', () => { // Generic name
@leobrines
leobrines / config.js
Created May 3, 2019
Enviroment configuration for NodeJS - "Twelve-Factor App" | https://12factor.net/config
View config.js
const enviroment = {};
Object.assign(enviroment, process.env);
for (let [key, value] of Object.entries(enviroment)) {
switch (value) {
case "true":
enviroment[key] = true;
break;
case "false":
enviroment[key] = false;
You can’t perform that action at this time.