Skip to content

Instantly share code, notes, and snippets.

@turbo
turbo / std.md
Last active June 24, 2024 03:00
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
@armollica
armollica / .block
Last active September 9, 2021 13:25
Shaded Relief Map
height: 1000
@croxis
croxis / gist:6436553c3542ec692c1d
Created March 24, 2015 00:08
Rendering procedural planets.
Based on feedback from ChemicalR I'm cross posting all the things I've bookmarked in reguards to planet rendering here in the code forums.
[url=http://www.gamasutra.com/view/feature/3098/a_realtime_procedural_universe_.php]Sean O'Neil[/url]'s 4 2001 part series is considered a foundation for realistic large scale (planets on up) rendering. Most of these methods are now obsolete and replaced with faster methods and gpu shaders. His [url=http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html]atmospheric scattering[/url]method is still used often due to its relative simplicity, but it only produces earth atmospheres.
[url=http://acko.net/blog/making-worlds-1-of-spheres-and-cubes/]Steven Wittens[/url] 2009 multipart series is frequently linked to as I've searched for best practices in creating planets using modern methods. It is based on a cube with mesh texture and normalizes the vertex points into a sphere. The advantage to this method is that conventional terrain LOD methods, often used in first
@pricees
pricees / value_investing.rb
Last active June 4, 2017 13:08
Value Investing (CROIC)
# Margins of Safety
# 30% > $ 10B
# 50% - 30% for $1-10B Market Cap
# > 50% for < $1B
# Owner's Earnings
# Read more: http://www.oldschoolvalue.com/blog/valuation-methods/working-capital-free-cash-flow-fcf/#ixzz3O1Egljwo
# Owner earnings = Net income + depreciation & amortization +/- one-time items +/- changes in working capital - capital expenditures
def owner_earnings # Better than free cash flow
@rubencaro
rubencaro / install_elixir.md
Last active September 30, 2023 03:58
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@devstator82
devstator82 / gist:3158327
Created July 22, 2012 04:01
On the business of e-mail clients / Sparrow

On the business of e-mail clients

I have been following the whole debate around this e-mail client (Sparrow) getting bought by Google. E-mail clients and the e-mail business are something close to my heart as I have once spent considerable amount of time on my own e-mail client.

People seem to be pretty upset about this acquisition because one of their favourite apps apparantly wont be updated anymore in the future, which is understandable. But lets look at this discussion from the other side: e-mail clients as a business.

Now I don't know the facts, nor do I know the good people at Sparrow. But I do know this space very well and know the facts about the space. My own Inbox2 desktop (for Windows) had about 500.000 downloads and is still being downloaded today (I stopped working on that about 2 years ago). I am assuming Sparrow did much better then this but still the essentials would remain the same.

The facts based on my own experience

@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@iainiain32
iainiain32 / main.rb
Created February 14, 2012 04:56
Read X-Plane UDP packets with Ruby
require 'rubygems'
require 'socket'
class Xplane
XP_SENDING_PORT = 49001 # X-Plane sends packets on this port
# These define the structure of the UDP packet.
XP_PACKET_HEADER = 'CCCCC'
XP_PACKET_DATA = 'lffffffff'
@Inscrutabilis
Inscrutabilis / GeodesicSphere.js
Created December 12, 2010 05:29
Three.js geodesic sphere primitive class
/**
* @author Inscrutabilis / mailto:iinscrutabilis@gmail.com
*/
/*
* Generates a geodesic sphere geometry
* By default, it is 1x1x1 octahedron, as a first approximation to sphere
* It will return more sphere-like object if you specify iterations > 0
* But please keep in mind that it generates (4 ^ iterations) * 8 faces
* Radius argument overrides default sphere radius (1)
@krobertson
krobertson / gist:233480
Created November 13, 2009 00:58
Ruby SMTP to XMPP server/gateway
require 'gserver'
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/roster'
require 'daemons'
JABBER_USER = 'service@domain.com'
JABBER_PASS = 'secret'
EMAIL_DOMAIN = 'domain.com'