Skip to content

Instantly share code, notes, and snippets.

@jfontan
jfontan / benchmark.go
Created Jan 15, 2018
Benchmark go-git. Time and memory to clone and push
View benchmark.go
package main
import (
"fmt"
"os"
"runtime"
"time"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
View repository_delete_test.go
package git
import (
// "time"
"github.com/src-d/go-git-fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
. "gopkg.in/check.v1"
View vim_scala.md

The integration uses ensime that was initially created for Emacs but can be used with VIM. The instructions bellow are for Arch Linux but the information should be useful for other distros or even MacOS X.

Documentation and web page for ensime is located at:

http://ensime.org/

Installation

@jfontan
jfontan / call_one.cr
Last active Jul 20, 2017
crystal xmlrpc
View call_one.cr
require "xmlrpc"
env = LibXMLRPC::Env.new
penv = pointerof(env)
LibXMLRPC.env_init(penv)
puts env.inspect
LibXMLRPC.client_init2(
View change_sound_card
#!/bin/bash
sound_card=$1
if [ -z "$sound_card" ]; then
echo "A sound card must be specified"
fi
pacmd set-default-sink "$sound_card"
View gist:be52701783c69b24f26ea6415957fda2
#!/bin/bash
COMMANDS="acl cluster datastore group host image market marketapp template user vnet secgroup"
for name in $COMMANDS; do
cmd=one${name}
${cmd} list > ${cmd}.list
${cmd} list -x > ${cmd}.list.xml
ids=$(${cmd} list | grep -v ID | awk '{print $1}')
View gist:8d12b8a3821e3d527dd3

Keybase proof

I hereby claim:

  • I am jfontan on github.
  • I am jfontan (https://keybase.io/jfontan) on keybase.
  • I have a public key whose fingerprint is D21C 9333 97D1 DEA7 6AB4 035A 5255 EB6C BBCE B6B3

To claim this, I am signing this object:

View base-vm.one
OS=[
ARCH="x86_64",
BOOT="network" ]
CPU="1"
MEMORY="768"
DISK=[
IMAGE="empty_10gb_disk" ]
NIC=[
View gist:368712
# Fix for ruby 1.8.5
def Object.class_variable_defined?(var)
Object.class_variables.include?(var.to_s)
end unless Object.respond_to? :class_variable_defined?
class Object
def instance_variable_defined?(var)
self.instance_variables.include?(var.to_s)
end unless Object.new.respond_to? :instance_variable_defined?
end
View gist:30907
require 'ftools'
FILE_DIR="files"
get "/upload_file/:id" do
@parent=params[:id]
erb :upload_file
end