Skip to content

Instantly share code, notes, and snippets.

View Jelby-John's full-sized avatar

John Lumley Jelby-John

View GitHub Profile
@Jelby-John
Jelby-John / glyphicons.files.css
Last active December 22, 2017 15:02
Glyphicons Pro in Twitter Bootstrap 3
@font-face { font-family: 'Glyphicons files'; src: url('../fonts/glyphicons-filetypes-regular.eot'); src: url('../fonts/glyphicons-filetypes-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-filetypes-regular.woff') format('woff'), url('../fonts/glyphicons-filetypes-regular.ttf') format('truetype'), url('../fonts/glyphicons-filetypes-regular.svg#glyphicons-filetypes-regular') format('svg'); } .glyphfiles { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons files'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }.glyphfiles-txt:before {content: "\e001"; }.glyphfiles-doc:before {content: "\e002"; }.glyphfiles-rtf:before {content: "\e003"; }.glyphfiles-log:before {content: "\e004"; }.glyphfiles-tex:before {content: "\e005"; }.glyphfiles-msg:before {content: "\e006"; }.glyphfiles-text:before {content: "\e007"; }.glyphfiles-wpd:before {content: "\e008"; }.glyphfiles-wps:before {con
@blacktm
blacktm / install_ruby_rpi.sh
Last active May 26, 2024 15:13
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@hannesl
hannesl / cantor_pairing.php
Created December 18, 2013 23:02
Cantor pairing functions in PHP. Pass any two positive integers and get a unique integer back. Feed the unique integer back into the reverse function and get the original integers back. Explanation and JS implementation here: http://stevegardner.net/2012/07/09/javascript-cantor-pairing-function-and-reverse-function/
<?php
/**
* Calculate a unique integer based on two integers (cantor pairing).
*/
function cantor_pair_calculate($x, $y) {
return (($x + $y) * ($x + $y + 1)) / 2 + $y;
}
/**