Skip to content

Instantly share code, notes, and snippets.

View murilobr's full-sized avatar

Murilo da Silva murilobr

View GitHub Profile
@murilobr
murilobr / bash-colors.md
Created December 5, 2021 14:06 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@murilobr
murilobr / Python3 Virtualenv Setup.md
Created November 3, 2021 19:21 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@murilobr
murilobr / postgres_queries_and_commands.sql
Created August 7, 2021 14:45 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Keybase proof

I hereby claim:

  • I am murilobr on github.
  • I am murilobr (https://keybase.io/murilobr) on keybase.
  • I have a public key ASBzvZGdHm2Lwk3A2f1_eIKGr8uzwan4b-LWv5sxNSD-Kgo

To claim this, I am signing this object:

@murilobr
murilobr / chartjsGauge.js
Created June 16, 2016 14:23
Chart.js Gauge
Chart.pluginService.register({
afterDraw: function(chart) {
if (chart.config.options.elements.center) {
var helpers = Chart.helpers;
var ctx = chart.chart.ctx;
ctx.save();
var width = (chart.chartArea.left + chart.chartArea.right),
height = (chart.chartArea.top + chart.chartArea.bottom);
@murilobr
murilobr / gist:def47f3628d4d2ecd66b
Created September 8, 2015 20:18
Prevent text selection jquery
$(":not(input,select,textarea)").attr('unselectable', 'on')
.css({'-moz-user-select':'-moz-none',
'-moz-user-select':'none',
'-o-user-select':'none',
'-khtml-user-select':'none', /* you could also put this in a class */
'-webkit-user-select':'none',/* and add the CSS class here instead */
'-ms-user-select':'none',
'user-select':'none'
}).bind('selectstart', function(){ return false; });
@murilobr
murilobr / remove.sh
Created May 7, 2015 19:49
Remove big file from git after commit
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., sh remove.sh path1 path2
if [ $# -eq 0 ]; then
exit 0
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@murilobr
murilobr / gist:3112721
Created July 14, 2012 19:00
Remove all brew installation
brew list | awk '{print "brew uninstall "$1}' | sh
@murilobr
murilobr / nginx.conf
Created June 7, 2012 20:27
NGINX.config simple example
events {
worker_connections 5;
}
http{
server {
listen 8090;
server_name localhost;
access_log /my_project_folder/access_nginx.log;
error_log /my_project_folder/error_nginx.log;