Skip to content

Instantly share code, notes, and snippets.

View rangelvarnier's full-sized avatar

Rangel Varnier rangelvarnier

View GitHub Profile
@rangelvarnier
rangelvarnier / rocketchat_invoke_webhook_python.py
Created August 26, 2020 19:44 — forked from ruanbekker/rocketchat_invoke_webhook_python.py
Invoke Rocketchat Incoming Webhook with Python
import requests
import json
uri = 'https://domain.com/hooks/1234AbcD'
data={}
data = {
"username": "Python Bot",
"icon_emoji": ":whale:",
"attachments": [
{
@rangelvarnier
rangelvarnier / fix_github_https_repo.sh
Created August 15, 2019 11:02 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@rangelvarnier
rangelvarnier / reset.sql
Created June 20, 2019 19:28 — forked from tbarbugli/reset.sql
reset all sequences on a postgres db
SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| ', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';'
FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C
WHERE S.relkind = 'S'
AND S.oid = D.objid
AND D.refobjid = T.oid
AND D.refobjid = C.attrelid
AND D.refobjsubid = C.attnum
ORDER BY S.relname;
@rangelvarnier
rangelvarnier / install_docker_elementary.sh
Last active July 27, 2018 02:07
Install Docker on Elementary OS 0.4.1 (Loki)
#!/bin/bash
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo rm -f /etc/apt/sources.list.d/docker.list
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"
sudo apt-get update
sudo apt-get install docker-ce
data:text/html, <body contenteditable style="font: 2rem/1.5 FiraCode Nerd Font;max-width:60rem;margin:0 auto;padding:4rem;">
@rangelvarnier
rangelvarnier / launch.json
Created March 29, 2018 17:50
vscode debug with tests configuration
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
@rangelvarnier
rangelvarnier / DockerSingleUser.txt
Created February 14, 2018 00:11
Running docker as non root user
If you are a single user and don't want to enter your password everytime while executing docker command, you have to add the current user in docker group.
#this is most likely already created while installing docker
$ sudo groupadd docker
$ sudo gpasswd -a $USER docker
# you might need to logout if the changes are not working
$ newgrp docker
@rangelvarnier
rangelvarnier / vscodestyles.css
Created November 8, 2017 23:23
css for vs code like a wes bos
.monaco-shell {
/* font-family: "Fira Code, Operator Mono", "Inconsolata", monospace; */
}
/*
Fat Cursor.
This overwrites the "underline thin" style since that is one that can be styled with CSS
So set your settings to:
"editor.cursorStyle": "underline-thin",
*/