Skip to content

Instantly share code, notes, and snippets.

Saulo Silva ssilva

Block or report user

Report or block ssilva

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ssilva
ssilva / DisableEnableNetworkAdapter.ps1
Created Nov 23, 2012
How to disable & enable a network adapter on Windows with PowerShell
View DisableEnableNetworkAdapter.ps1
# Get the network adapter object
$adapter = Get-WmiObject -Class Win32_NetworkAdapter |
Where-Object {$_.Name -eq "TP-LINK Wireless USB Adapter"}
# Disable it
Write-Host -nonew "Disabling $($adapter.Name)... ";
$result = $adapter.Disable()
if ($result.ReturnValue -eq -0) {
Write-Host "Success.";
} else {
View quotes.md
  • No Mundo Maior (13)
  • Paulo e Estêvão
  • Pensamento e Vida
  • A Caminho da Luz (82)
  • Vinha de Luz
  • O Consolador (58)
  • Cinquenta Anos Depois (14)
  • Voltei (10)
  • Memórias de um suicida
  • Caminho, Verdade e Vida (104)
View keybase.md

Keybase proof

I hereby claim:

  • I am ssilva on github.
  • I am ssilva (https://keybase.io/ssilva) on keybase.
  • I have a public key ASD4uTWrjL1lBlfQGqbAru4GQOh6xWzDYXAhwleLTkxMnwo

To claim this, I am signing this object:

View ruby.html
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Ruby</title>
</head>
<body>
<p>
<ruby>
明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp>
@ssilva
ssilva / main.rs
Last active Jul 20, 2018
Simple grid: C vs Rust
View main.rs
extern crate rand;
use rand::Rng;
const ROWS: usize = 10;
const COLS: usize = 80;
const ANSI_COLOR_RED: &str = "\x1b[31m";
const ANSI_COLOR_GREEN: &str = "\x1b[32m";
const ANSI_COLOR_BLUE: &str = "\x1b[34m";
View bootstrap-vim.md

Bootstrapping Vim

  1. Install vim-plug
    curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    
  2. Clone .vimrc
  3. vim +PlugInstall +qall
  4. In Vim :Obsess ~/.vim/mysession.vim
@ssilva
ssilva / .vimrc
Created Jul 19, 2018
.vimrc using Plug
View .vimrc
" Plug: https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-obsession'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-markdown'
Plug 'itchyny/lightline.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'airblade/vim-gitgutter'
Plug 'chriskempson/base16-vim'
@ssilva
ssilva / disassembler.c
Last active Jul 17, 2018
8080 emulation
View disassembler.c
#include <stdlib.h>
#include <stdio.h>
// Started from http://emulator101.com/
int disassemble_op(unsigned char *codebuffer, int pc)
{
unsigned char *code = &codebuffer[pc];
int opbytes = 1;
View gameboy_opcodes.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Gameboy (LR35902) OPCODES</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<style type="text/css"> <!--
table.withborder {
border-width: 1px;
border-style: solid;
View tricks-and-tips.md

Command-line

Sum of numbers

Pipe to awk '{s+=$1} END {print s}' or paste -s -d+ - | bc (here paste joins the numbers into one line)

vim

  • { extends the selection until the next empty line

Macros

You can’t perform that action at this time.