Skip to content

Instantly share code, notes, and snippets.

View ghg's full-sized avatar

Gregory Graf ghg

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active January 28, 2026 19:31
Springer made a bunch of books available for free, these were the direct links
@djonsson
djonsson / install_elasticsearch_osx.md
Last active June 12, 2025 07:13
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@cdipaolo
cdipaolo / HaversinFormula.go
Created April 15, 2015 01:31
Golang functions to calculate the distance in meters between long,lat points on Earth.
// haversin(θ) function
func hsin(theta float64) float64 {
return math.Pow(math.Sin(theta/2), 2)
}
// Distance function returns the distance (in meters) between two points of
// a given longitude and latitude relatively accurately (using a spherical
// approximation of the Earth) through the Haversin Distance Formula for
// great arc distance on a sphere with accuracy for small distances
//
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@jschairb
jschairb / command_capture.rb
Created January 31, 2013 02:04
Proof of Concept for storing command-line interaction in YAML files similar to VCR does with HTTP requests.
require 'logger'
require 'yaml'
class CommandsFile
FILE_PATH = File.join(File.dirname(__FILE__), "commands.yml")
def self.load
commands_file = new
commands_file.load
end
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")