Skip to content

Instantly share code, notes, and snippets.

Isaac Andrade andradei

Block or report user

Report or block andradei

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
@andradei
andradei / 0-ssh-host-to-guest.md
Last active Jul 15, 2019
VirtualBox Ubuntu Server 16.04 Development Setup
View 0-ssh-host-to-guest.md

Setup SSH from Host to Guest on VirtualBox

  1. Make sure VM is shutdown
  2. Go to Network settings of the VM you want to SSH in
  3. Generally the first Adapter is set to NAT. Go to Advanced and click in Port Forwarding
  4. Create a new rule (click in the icon with a "+" sign) and enter:
Name Protocol Host IP Host Port Guest IP Guest Port
ssh TCP 2222 22
@andradei
andradei / main.go
Created Mar 28, 2016
The Daily Walk - Go Concurrency Exercise
View main.go
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
var (
@andradei
andradei / go-impl.sh
Last active Mar 11, 2016
Bash function to use Go's tooling
View go-impl.sh
# Implement `oracle implements` with help to find byte offsets to use
# Usage: go-impl [path-to-file].go [identifier type]
# Example: go-impl somepackage/file.go MyType
if [[ -n $1 && -n $2 ]]; then
if [[ -a $1 ]]; then
cat $1 | grep -b $2
echo "Choose a byte offset from the list above"
local byte_offset
read byte_offset
oracle -pos $1:"#"$byte_offset implements
View frisk_sargas.zsh-theme
PROMPT='
%{$fg[cyan]%}$(virtualenv_prompt_info)%{$reset_color%}%{$fg[blue]%}%c%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info)%{$fg[yellow]%}[%T]%{$reset_color%} %{$fg_bold[white]%}➤%{$reset_color%} '
PROMPT2="%{$fg_bold[black]%}➤ %{$reset_color%}"
GIT_CB="git: "
ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
@andradei
andradei / main.cpp
Created Nov 17, 2015
Tic-Tac-Toe in C++
View main.cpp
//
// main.cpp
// Tic-Tac-Toe
//
// Created by Isaac Andrade on 9/2/13.
// Copyright (c) 2013 Isaac Andrade. All rights reserved.
//
#include <iostream>
#include <string>
@andradei
andradei / pi_approximation.rb
Created Nov 17, 2015
PI Approximation in Ruby
View pi_approximation.rb
module PiApprox
class PI
attr_accessor :approximation, :denominator, :sum, :signal
def initialize(approx = 0, den = 1.0, sum = 0, signal = true)
@approximation = approx
@denominator = den
@sum = sum
@signal = signal
end
@andradei
andradei / app.py
Last active Nov 17, 2015
Async Planet Destroyer in Python (asyncio)
View app.py
import asyncio
import logging
class Client(asyncio.Protocol):
def __init__(self, loop):
self.loop = loop
def connection_made(self, transport):
View 01exercise-loops-and-functions.go
package main
import (
"fmt"
)
func Sqrt(x float64) float64 {
z := float64(x)
delta := 10.0
var temp float64
@andradei
andradei / sb3_keybindings_vowels.json
Last active Aug 29, 2015
Sublime Text 3 Key Bindings for Vowals with Accent (use with keyboard layout US, International with Dead Keys and similar)
View sb3_keybindings_vowels.json
[
// Key remaps
// - a
{ "keys": ["alt + ' + a"], "command": "insert", "args": {"characters": "á"}},
{ "keys": ["alt + ` + a"], "command": "insert", "args": {"characters": "à"}},
{ "keys": ["alt + \" + a"], "command": "insert", "args": {"characters": "ä"}},
{ "keys": ["alt + ~ + a"], "command": "insert", "args": {"characters": "ã"}},
// - A
You can’t perform that action at this time.