Skip to content

Instantly share code, notes, and snippets.


Anderson Fraga andersonfraga

View GitHub Profile
View Default.sublime-keymap
{ "keys": ["ctrl+shift+l"], "command": "copy_basename_file" },
{ "keys": ["ctrl+shift+g"], "command": "copy_basename_file_github" }
andersonfraga /
Created May 8, 2020 — forked from pwnsdx/
Disable bunch of #$!@ in Catalina
# 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/
# 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);
View gist:74f57527d7397a1ec2a35aace79543b7
; vim /etc/apt/sources.list
deb jessie main non-free contrib
deb-src jessie main non-free contrib
; terminal
sudo apt update
sudo apt install gcc-4.8 g++-4.8
; vim /etc/apt/sources.list
#deb jessie main non-free contrib
andersonfraga /
Last active Mar 2, 2018
Xfce 4.12 it's dumb and stupid. So I need to manually inform the order of monitors and their panel's location
# source
# 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
View client.c
#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;
View philosopher.c
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
typedef struct philosopher_sct {
int think;
int waited;
andersonfraga /
Created May 27, 2016
Execute notify-send via cronjob
# * * * * * /bin/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-)
DISPLAY=:0.0 /usr/bin/notify-send --urgency=critical "Alert using crontab" "$1"
} >> $HOME/crontab/alert.log 2>&1
andersonfraga / divisible.go
Created May 17, 2016
Brincando com go... But, tem será maneira mais 'go-style' de fazer isso?
View divisible.go
package main
import "os"
import "fmt"
import "math"
import "strconv"
func main() {
number, _ := strconv.ParseFloat(os.Args[1:2][0], 64)
denom := float64(2)
View Lexica_01.flex
* Anderson Jean Fraga
* 13180375
* Compiladores - Trabalho 1 - Exercicio 1
%class Lexica_01