Skip to content

Instantly share code, notes, and snippets.

View rthor's full-sized avatar

Ragnar Þór Valgeirsson rthor

View GitHub Profile
@rthor
rthor / input.ini
Last active August 29, 2015 14:10
LOL Reverse mouse buttons
[GameEvents]
evtUseVisionItem=[x]
evtChampionOnly=[<Unbound>]
evtPlayerMoveClick = [Button 1]
evtPlayerSelectClick = [Button 2]
[HUDEvents]
evtOnUIMouse1 = [Button 2], [Button 1]
@rthor
rthor / Ghost.css
Created September 16, 2014 08:31
Vertical center
.Ghost::before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
.Ghost-center {
display: inline-block;
vertical-align: middle;
% Two sided, icelandic
\documentclass[english,a4paper,twoside]{amsart}
\usepackage[pdftex]{color,graphicx} %Used for inputting pdf graphics into document
% Enable for hyperlinks in the file THIS MUST BE THE LAST COMMAND IN THE PREAMBLE TO WORK!
\usepackage[pdftex]{hyperref}
\usepackage{tikz}
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
@rthor
rthor / README.md
Last active April 26, 2017 08:59
Sort algorithm for Icelandic characters and other special characters.

Usage

Create some array:

var names = [
  'Jón Margeir Jónson',
  'Fríður',
  'Ægir',
  'Friðgeir',
if ( condition ) {
// some code...
if ( !anotherCondition ) {
// more code if anotherCondition is falsy...
}
}
@rthor
rthor / grp.js
Created August 6, 2013 20:18
Use console.group like a boss...
// When not using jQuery...
var isArray = Array.isArray || function (obj) {
return obj && typeof obj === 'object' && typeof obj.length === 'number' && !obj.propertyIsEnumerable('length');
};
// Log grouped statements...
var grp = function ( title, arr ) {
arr = arr.reverse();
var len = arr.length,
@rthor
rthor / Fixed-Navigation.css
Created July 5, 2013 11:08
Makes the navigation scroll with the page when it hits the navigation.
nav.fixed {
position: fixed;
top: 0;
margin-top: 0;
z-index: 1111;
}
/**
* Returns a random number between min and max
*/
function getRandomArbitary (min, max) {
return Math.random() * (max - min) + min;
}
/**
* Returns a random integer between min and max
* Using Math.round() will give you a non-uniform distribution!
@rthor
rthor / Chromeframe-is.html
Created March 26, 2013 18:30
Icelandic chrome frame comment and styling...
<!--[if lt IE 7]>
<div class="chromeframe">
<div class="container">
<p>Þú er að nota <strong>úreltann</strong> vafra. Vinsamlegast <a href="http://browsehappy.com/">uppfærið vafrann</a> eða <a href="http://www.google.com/chromeframe/?redirect=true">gerið Google Chrome Frame virkt</a> til að gera þessa síðu nothæfa.</p>
<hr>
<p class="en">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
</div>
</div>