Skip to content

Instantly share code, notes, and snippets.

View BernardoGO's full-sized avatar

Bernardo Augusto Godinho de Oliveira BernardoGO

  • Pontifical Catholic University of Minas Gerais
  • Belo Horizonte - Brazil
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Reflect
{
///by: Bernardo Godinho <bernardo.godinho.oliveira@gmail.com>
class ReflectionValues
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace XMLSK
{
///by: Bernardo Godinho <bernardo.godinho.oliveira@gmail.com>
static class XMLhl
@BernardoGO
BernardoGO / gist:430742263e3fc828f461
Created February 26, 2015 01:50
PIC16F628A Blink on xc8
/******************************************************************************/
/* Files to Include */
/******************************************************************************/
//by: BernardoGO
#if defined(__XC)
#include <xc.h> /* XC8 General Include File */
#elif defined(HI_TECH_C)
#include <htc.h> /* HiTech General Include File */
bernardo@bernardo-P650SE-A:~$ uname -a
Linux bernardo-P650SE-A 3.19.0-31-generic #36~14.04.1-Ubuntu SMP Thu Oct 8 10:21:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
bernardo@bernardo-P650SE-A:~$ sh get-acpi-info.sh
Dumping ACPI tables...
[sudo] password for bernardo:
Intel ACPI Component Architecture
ACPI Binary Table Extraction Utility version 20140214-64 [Mar 29 2014]
Copyright (c) 2000 - 2014 Intel Corporation
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include "message.h"
#include <cstring>
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#!/bin/sh
echo small-
if diff /home/bernardo/Downloads/pa2/server/input_small.txt /home/bernardo/Projects/redes2/input_small.txt >/dev/null ; then
echo Same
else
echo Different
fi
echo medium-
if diff /home/bernardo/Downloads/pa2/server/input_medium.txt /home/bernardo/Projects/redes2/input_medium.txt >/dev/null ; then
@BernardoGO
BernardoGO / OpenWithSublimeText3.bat
Created November 29, 2015 08:38
Add "Open with Sublime Text 3" to Windows Explorer Context Menu (including folders)
@echo off
SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@BernardoGO
BernardoGO / simplegui.py
Created November 29, 2015 20:15
Python Simple GUI to run another script
from Tkinter import *
root = Tk()
S = Label(root, text ="grupo:")
S.pack()
T = Text(root, height=2, width=30)
@BernardoGO
BernardoGO / P650SE_Suspend_Fix.sh
Last active March 20, 2016 00:15
Bash script used to fix suspend/resume on clevo computers that drains a lot of power while sleeping
#! /bin/sh
GPUDRIVER=nvidia
#if [ ! -x /sys/bus/usb/devices/${BUS}-${DEVICE}/power/level ]; then
# exit 0
#fi
case "$1" in
suspend|suspend_hybrid|hibernate)
#! /bin/sh
GPUDRIVER=nvidia
#if [ ! -x /sys/bus/usb/devices/${BUS}-${DEVICE}/power/level ]; then
# exit 0
#fi
case "$1" in
suspend|suspend_hybrid|hibernate)