Skip to content

Instantly share code, notes, and snippets.

View proudlygeek's full-sized avatar
🏃‍♂️

Gianluca Bargelli proudlygeek

🏃‍♂️
View GitHub Profile
#!/bin/bash
# Callbell LATAM Latency Test
# Usage: curl -sL https://gist.githubusercontent.com/YOUR_USER/YOUR_GIST_ID/raw/callbell-latency-test.sh | bash
echo "========================================"
echo " Callbell LATAM Latency Test"
echo "========================================"
echo ""
@proudlygeek
proudlygeek / nfs-tunnel.md
Last active January 21, 2026 09:04
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports
@proudlygeek
proudlygeek / commands-channel.go
Last active March 31, 2024 03:31
Golang Commands in Goroutines
package main
import (
"fmt"
"log"
"os/exec"
"runtime"
)
type Worker struct {
@proudlygeek
proudlygeek / broccoli_rspec_formatter.rb
Created September 3, 2018 13:49
Broccoli Formatter 🥦
class BroccoliFormatter
RSpec::Core::Formatters.register self, :dump_pending, :dump_failures, :close, :dump_summary, :example_passed, :example_failed, :example_pending
def initialize(output)
@output = output << "\n"
end
def example_passed(_notification)
@output << ' 🥦 '
end
@proudlygeek
proudlygeek / cocreteType.go
Created April 28, 2014 10:46
Opaque interfaces in Golang
package opaque
type internalBasicType int
//
// Prevents the interface to be implemented
// *outside* the package, since is lowerCase (thus private).
//
// This is best suited for API and things we don't
// wanna people to override.
@proudlygeek
proudlygeek / cat.go
Created November 4, 2012 16:02
Unix "cat" command in Go
package main
import (
"fmt"
"os"
"io"
"log"
"io/ioutil"
)
@proudlygeek
proudlygeek / rot13.js
Last active April 7, 2022 10:18
ROT13 Kata
// http://www.codewars.com/kata/52223df9e8f98c7aa7000062/train/javascript
function rot13(str) {
var lower = "abcdefghijklmnopqrstuvwxyz",
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
mod = upper.length;
return str
.split('')
.map(function(i) {
@proudlygeek
proudlygeek / app.js
Created June 24, 2014 15:02
React JS Todo APP
/** @jsx React.DOM */
var InputForm = React.createClass({
handleSubmit: function(e) {
e.preventDefault();
var value = this.refs.text.getDOMNode().value;
this.props.onAddItem({ text: value, done: false });
this.refs.text.getDOMNode().value = '';
},
render: function() {
return (
@proudlygeek
proudlygeek / nested.txt
Created January 19, 2022 09:30 — forked from alexey-milovidov/nested.txt
Example of Nested data type in ClickHouse.
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192)
CREATE TABLE test.nested
(
EventDate Date,
UserID UInt64,
Attrs Nested(
Key String,
Value String)
) ENGINE = MergeTree(EventDate, UserID, 8192)
@proudlygeek
proudlygeek / client_cors.js
Created July 17, 2012 20:48
JSONP Vs. CORS
// http://jsfiddle.net/suBPQ/
$.ajax({
url: "http://api_test_server.proudlygeek.c9.io/",
success: function(data) {
console.log(data);
}
});​