Skip to content

Instantly share code, notes, and snippets.

View rodolfobandeira's full-sized avatar

Rodolfo rodolfobandeira

View GitHub Profile
@walquis
walquis / Gemfile
Last active December 4, 2021 20:53
Ruby examples of sorting, including overriding spaceship operator
source 'http://rubygems.org'
gem 'rspec'
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 6, 2025 13:07
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dbrady
dbrady / hash_to_breadcrumb.rb
Created May 12, 2015 13:49
hash_to_breadcrumb - turn a hash containing items, arrays, or nested hashes into a flattened list of "breadcrumbs" -- e.g. the path through the hash to get to the last value in the list.
# hash_to_breadcrumbs
#
# hash_to_breadcrumb - turn a hash containing items, arrays, or nested hashes
# into a flattened list of "breadcrumbs" -- e.g. the path through the hash to
# get to the last value in the list.
hash = {
a: 1,
b: [2, 3, 4],
c: {
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@gourneau
gourneau / ElasticSearch.sh
Last active December 12, 2017 21:06
Elastic Search 1.4.2 with Oracle Java 8
### Install Oracle Java 8, this means you agree to their binary license!!
cd ~
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo aptitude -y install oracle-java8-installer
### Download and Install ElasticSearch
@kneels
kneels / fizzbuzz.s
Last active July 2, 2022 15:49
x86 Assembly FizzBuzz
section .text
global _start
_start: ; entry point
mov ecx, 1 ; set loop counter
loop_main:
push ecx ; save loop counter
xor dx, dx ; reset dx
mov ax, cx
@hectorperez
hectorperez / copy word under cursor in Vim.txt
Created August 7, 2014 13:37
copy word under cursor in Vim
copy/delete word under cursor in Vim
yw / byw
Assuming that the cursor is at the first character of the word simply do this in command mode:
yw
y is for yank and w is for word.
Other ways of doing the same thing which are not as efficient:
vey
the v starts visual select mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x.

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

@thomd
thomd / semantic-layout.html
Last active November 11, 2024 20:30
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash