Skip to content

Instantly share code, notes, and snippets.

View riovv's full-sized avatar

riovv

  • Digital Illusions CE (DICE)
  • Sweden
View GitHub Profile
@riovv
riovv / autoexec.cfg
Last active June 5, 2021 10:45
cs 1.6 cfg
cl_bob 0
cl_bobcycle 0
cl_minmodels 1
cl_cmdrate "101"
cl_updaterate 102
max_shells 10
max_smokepuffs 0
rate 25000
fps_max "101"
@riovv
riovv / csgo_buynds.cfg
Last active July 11, 2019 15:16
Buy binds for CS:GO
// CS:GO buynds
// Keeping it simple to avoid misbuys
// If I want to buy something else I first purchase armor, kit etc. then manually buy that weapon.
//
// Put this in your "csgo/cfg/autoexec.cfg"
//
// =======================
// NUMPAD
// =======================
// 0 = Vest+Helm or Vest only
@riovv
riovv / fib.js
Created September 24, 2012 15:08
Simple iterative way to calculate the nth number in the fibonacci sequence
var fib = function (n) {
var i,
fn = 0,
f1 = 0,
f2 = 1;
if (n < 2) return n;
for (i = 2; i <= n; i++) {
fn = f1 + f2;
@riovv
riovv / array_inversion.js
Created August 24, 2012 15:00
Unreadable Array inversion counter!
/*
* Count inversions in an array using JavaScript
* Friday fun writing algorithms as UNREADABLE CODE WITH FEW LINEZ FTW :D::D
*/
var array_inversions = function (A) {
var I = 0,
R = function (A) { return (A.length < 2) ? A : M(R(A.splice(0, A.length/2)), R(A)) },
M = function (B, C) {
var D = []
@riovv
riovv / gist:1817251
Created February 13, 2012 14:24
Find large files on linux
# Find files > 20MB
find . -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# Find directories >= 1GB
du -h . | grep ^[0-9.]*G
@riovv
riovv / index.js
Created January 28, 2012 10:29
Facebook Hacker Cup - Single file boilerplate
/**
* Written in Node.js
* http://nodejs.org
*
* Author: Patric Nordmark
*
* Usage: node index.js [-t [n]] [<input file>] [<output file>]
*
* Running node index.js without any parameters will solve all
* test cases in input.txt and write the results to output.txt
@riovv
riovv / gcd.js
Created January 27, 2012 21:16
JavaScript: Greatest Common Divisor
// JavaScript: Greatest Common Divisor
var gcd = function (n, m) {
var r = 0;
while (n !== 0) {
r = m % n;
m = n;
n = r;
}
return m;
};