Skip to content

Instantly share code, notes, and snippets.

View andersonfraga's full-sized avatar
🧩
Focusing

Anderson Fraga andersonfraga

🧩
Focusing
View GitHub Profile

Tentarei, nesse pequeno gist, expor um pouco sobre minha ética de trabalho, meu dia a dia, expectativas e como podemos fortalecer nosso trabalho. É um documento que, frequentemente, sofrerá ajustes :)

Obviamente, esse documento não deve impedir, jamais, qualquer tipo de comunicação pessoal entre nós. Se for algum assunto formal, convide para um café. Informal? A primeira rodada é por minha conta ;)

Objetivo desse documento

  • Dar uma ideia inicial sobre quem sou
  • Tentar criar alicerces para uma comunicação clara entre nós

Meu trabalho

[
{ "keys": ["ctrl+shift+l"], "command": "copy_basename_file" },
{ "keys": ["ctrl+shift+g"], "command": "copy_basename_file_github" }
]
@andersonfraga
andersonfraga / disable.sh
Created May 8, 2020 13:57
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
class A<T> {
private T var;
public A(T elm) {
var = elm;
}
public void damm() {
// this.var para simplificar
fun((T) method.invoke(this.var);
; vim /etc/apt/sources.list
deb http://http.debian.net/debian/ jessie main non-free contrib
deb-src http://http.debian.net/debian/ jessie main non-free contrib
; terminal
sudo apt update
sudo apt install gcc-4.8 g++-4.8
; vim /etc/apt/sources.list
#deb http://http.debian.net/debian/ jessie main non-free contrib
@andersonfraga
andersonfraga / start-displays.sh
Last active March 2, 2018 18:17
Xfce 4.12 it's dumb and stupid. So I need to manually inform the order of monitors and their panel's location
#!/bin/bash
# source https://forum.xfce.org/viewtopic.php?pid=46361#p46361
#
# Check if our external monitor name is in the list connected displays
grep_output=`xrandr | grep "HDMI-1 connected"`
if [ "$grep_output" != "" ]; then
# The external monitor IS connected. Put it right of there internal and move xfce-panel there
#include <string.h>
#include "headers.h"
int main(int argc, char const *argv[])
{
int id_shared, id_server;
char *psh_msg;
sem_t *sem_server;
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define NANO_SECOND_MULTIPLIER 1000000
typedef struct philosopher_sct {
int think;
int waited;
@andersonfraga
andersonfraga / cronjob.sh
Created May 27, 2016 20:23
Execute notify-send via cronjob
#!/bin/bash
# * * * * * /bin/sh cronjob.sh "Teste 1 2 3"
{
PID=$(/usr/bin/pgrep gnome-session)
dbus=$(/bin/grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
export DBUS_SESSION_BUS_ADDRESS=$dbus
DISPLAY=:0.0 /usr/bin/notify-send --urgency=critical "Alert using crontab" "$1"
} >> $HOME/crontab/alert.log 2>&1
@andersonfraga
andersonfraga / divisible.go
Created May 17, 2016 02:54
Brincando com go... But, tem será maneira mais 'go-style' de fazer isso?
package main
import "os"
import "fmt"
import "math"
import "strconv"
func main() {
number, _ := strconv.ParseFloat(os.Args[1:2][0], 64)
denom := float64(2)