Skip to content

Instantly share code, notes, and snippets.

View paulogr's full-sized avatar
🏠
Working from home

Paulo paulogr

🏠
Working from home
  • São Paulo, Brazil
  • 12:31 (UTC -03:00)
View GitHub Profile
@paulogr
paulogr / gist:93dc928edbd62a342a1440d671614647
Created March 30, 2021 19:56 — forked from nilo/gist:c2a31a0f9f29c88145ca
Using cedilha - ArchLinux Cinnamon
Author: Nilo Dantas - n1lo
Based on: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/518056 - helio-valente post
How to use Cedilha on US Keyboard on ArchLinux
1) Put: English(US, internacional with dead Keys) on your system keyboard layout.
2) Editing the files:
sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache
@paulogr
paulogr / macos-mouse-tracking-speed.md
Last active April 24, 2018 10:56
Speed up Mac OS mouse tracking

Read current value, System Preference maximum speed is 3.0

$ defaults read -g com.apple.mouse.scaling

Write the new value, for me 7.0 is perfect

$ defaults write -g com.apple.mouse.scaling 7.0

@paulogr
paulogr / git.md
Last active February 21, 2018 13:45
Git useful commands

Merge commit

View log

git log

Reabase

git rebase -i <commit>

Squash

change pick to squash

@paulogr
paulogr / Docker.md
Last active February 21, 2018 17:27
docker un

docker run -d --name mongo -p 27017:27017 mongo

@paulogr
paulogr / gist:1524665cd874bb774bf306c83815f7e8
Created February 6, 2018 21:20
Remove node_modules directories recursively
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@paulogr
paulogr / gist:df1a6358d98de98b07cc7e6b2647fbba
Created February 4, 2018 02:32
Get top 20 changed files of a git repository
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -20
@paulogr
paulogr / main.go
Created January 8, 2018 12:17 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@paulogr
paulogr / tcpproxy.js
Created December 7, 2017 02:28 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}
@paulogr
paulogr / app.ts
Created October 6, 2017 11:39 — forked from vsavkin/app.ts
@Component({
template: `
<spinner *ngIf="showSpinner|async"></spinner>
`
})
class AppCmp {
showSpinner: Observable<boolean>;
constructor(r: Router) {
this.showSpinner = r.events.
// Fitlers only starts and ends.
@paulogr
paulogr / ssr.js
Created September 28, 2017 12:22 — forked from mortenson/ssr.js
Flexible server side rendering script for Stencil when used in other platforms
// Put this file in a directory where @stencil/core exists in node_modules, then run:
// $ echo $HTML | node ssr.js [root] [build-dir] [namespace]
// Full example from my use case:
// $ echo '<sam-text text="Hello, world"></sam-text>' | node ssr.js /var/www/stencil/sams-components/dist ../ sam
// Pipes are used because HTML strings can be really long, and bash has limits on how large argument lists can get (~256k usually).
var stencil = require('@stencil/core');
var args = process.argv.slice(2);
if (args.length < 3) {
console.error('Not enough args');
}