Skip to content

Instantly share code, notes, and snippets.

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:

require 'ftools'
FILE_DIR="files"
get "/upload_file/:id" do
@parent=params[:id]
erb :upload_file
end
# 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
#!/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}')
@jfontan
jfontan / change_sound_card
Created January 30, 2017 16:25
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"
@jfontan
jfontan / call_one.cr
Last active July 20, 2017 10:33
crystal xmlrpc
require "xmlrpc"
env = LibXMLRPC::Env.new
penv = pointerof(env)
LibXMLRPC.env_init(penv)
puts env.inspect
LibXMLRPC.client_init2(

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

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"
@jfontan
jfontan / benchmark.go
Created January 15, 2018 09:58
Benchmark go-git. Time and memory to clone and push
package main
import (
"fmt"
"os"
"runtime"
"time"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
OS=[
ARCH="x86_64",
BOOT="network" ]
CPU="1"
MEMORY="768"
DISK=[
IMAGE="empty_10gb_disk" ]
NIC=[