Skip to content

Instantly share code, notes, and snippets.

Yves Junqueira nictuku

Block or report user

Report or block nictuku

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
@nictuku
nictuku / gist:997386
Created May 29, 2011
golang union types.
View gist:997386
// Objective: demonstrate that there are more use cases
// for union types than previously thought.
// http://groups.google.com/group/golang-nuts/browse_thread/thread/fbde059a7cfd2fa9
//
// Interface inference.
// We already have type inference, so this would be very Go-like:
type typeA int
func (x typeA) A() {}
func (x typeB) C() {}
@nictuku
nictuku / sshd.go
Created Apr 8, 2012
Go SSH server complete example
View sshd.go
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/terminal"
View gist:472767cc99b5ebbf5f1cc3676b760baa
Running: /root/.yourbase/tools/miniconda3/miniconda-4.7.10/bin/conda update -q conda in /workspace
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /root/.yourbase/tools/miniconda3/miniconda-4.7.10
added / updated specs:
- conda
View gist:10e85d74efc116d6d15b8383965af4f4
dependencies:
build:
- python:3.6.3
- heroku:latest
- homebrew:latest
runtime:
- python:3.6.3
- heroku:latest
- homebrew:latest
View yourbase example (hypothetical).toml
[dependencies]
build = [
"python:3.6.3",
"heroku:latest",
"homebrew:latest"
]
runtime = [
"python:3.6.3",
"heroku:latest",
"homebrew:latest"
View gist:57f5f059c6df17d2358aa6ec765e3bcc
package main
import (
"fmt"
"os"
hetzner "github.com/appscode/go-hetzner"
)
// Problem: this library and perhaps the underlying API don't seem to provide access to the server bidding stuff.
View gist:c9858a4fe2c7b92a01da2e635b7c147c
$ go tool dist list
android/386
android/amd64
android/arm
android/arm64
darwin/386
darwin/amd64
darwin/arm
darwin/arm64
dragonfly/amd64
View idempotent-git-clone.sh
#!/bin/bash
function clone() {
repo=$1 # https://github.com/fatih/vim-go.git
dest=$2 # ~/.vim/pack/plugins/start/vim-go
mkdir -p $dest
cd $dest
git init
if ! git config remote.origin.url &> /dev/null;then
git remote add origin $repo
View scaleway-virtualbox-module-build.sh
#!/bin/bash
# Expects Ubuntu 16.06 (xenial) and kernel 4.x.
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191
set -eux
# Have the user call sudo early so the credentials is valid later on
sudo whoami
View gist:28f7b7b1f3f5748aaa514c35b9e48a4a
[########################------------------------------------------------------------------------------------] 326/1458Error: ENFILE: file table overflow, open '/Users/yves/src/github.com/philipithomas/moonlight/frontend/package.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at onUnexpectedError (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:89324:104)
at /usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:89431:7
at <anonymous>
make: *** [deps] Error 1
-bash: cannot make pipe for command substitution: Too many open files in system
-bash: /Users/yves/.bash_eternal_history: Too many open files in system
You can’t perform that action at this time.