Skip to content

Instantly share code, notes, and snippets.

View ejemba's full-sized avatar

Epo Jemba ejemba

  • Kametic
  • France
View GitHub Profile
@lhuard1A
lhuard1A / core.go
Created September 2, 2015 16:30
How to create a GO program that cores…
package main
import (
"fmt"
)
// #include <stdlib.h>
// #include "signal.h"
import "C"
@andfaulkner
andfaulkner / cut_command_examples.sh
Last active August 3, 2022 13:58
Unix "cut" examples
which node
#-->node: /usr/bin/node /usr/bin/X11/node /usr/local/bin/node /usr/share/man/man1/node.1.gz
which node | cut -d':' -f1
#-->node
which node | cut -d':' -f2
#--> /usr/bin/node /usr/bin/X11/node /usr/local/bin/node /usr/share/man/man1/node.1.gz
which node | cut -d':' -f3
@detiber
detiber / gist:dd852beb2885a2ca2540
Created April 1, 2015 16:09
Using origin content with byo playbooks
Set the following variables:
openshift_additional_repos:
- id: ose-devel
name: ose-devel
baseurl: https://copr-be.cloud.fedoraproject.org/results/maxamillion/origin-next/epel-7-x86_64/openshift-0.4.1-1.el7.centos/
enabled: 1
gpgcheck: 0
openshift_registry_url="--images='openshift/origin-${component}"
@alecthegeek
alecthegeek / go-install-tools
Last active September 3, 2015 18:18
Set up a "standard" go project workspace with support for 3rdparty modules, version control repo and a template main package
# Install all the Go tools and godep tool
# Location of gobin is based on installation by OS X Homebrew
sudo -u admin GOPATH=/tmp GOBIN=/usr/local/opt/go/bin go get -u golang.org/x/tools/cmd/...
sudo -u admin GOPATH=/tmp GOBIN=/usr/local/opt/go/bin go get -u github.com/tools/godep
@geedew
geedew / vagrant-scp
Last active July 22, 2017 15:16
Copying files to a Vagrant VM from host
#!/bin/sh
# Change these settings to match what you are wanting to do
FILE=/File/To/Copy
SERVER=localhost
PATH=/Where/To/Put/File
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} $FILE vagrant@$SERVER:$PATH
@nathansgreen
nathansgreen / ProxyTest.java
Last active June 16, 2022 19:07
java.lang.reflect.Proxy over Annotation
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
@hvoecking
hvoecking / translate.go
Last active March 28, 2024 13:52
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@hgomez
hgomez / download-java8.sh
Created March 19, 2014 20:39
wget to download Java 8
wget --continue --no-check-certificate -O jdk-8-linux-x64.tar.gz --header Cookie: oraclelicense=a http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.tar.gz
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@smandy
smandy / casper.el
Created March 8, 2014 22:46
how to list fonts in emacs
(mapcar (lambda (x) ( insert (format "\n(set-frame-font \"%s\")" x ) ) ) (x-list-fonts "*") )