Skip to content

Instantly share code, notes, and snippets.

Patric Nordmark patrio

Block or report user

Report or block patrio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View autoexec.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"
@patrio
patrio / RandomAccessFIFA.md
Last active Aug 29, 2015
Random Access FIFA tournament BO11 with totally random teams
View RandomAccessFIFA.md
# Patric Elton Result
1 Wisła Kraków Manchester City 2 - 5
2 NY Red Bulls Gil Vicente 2 - 3
3
4
5
6
7
8
@patrio
patrio / csgo_buynds.cfg
Last active Mar 1, 2017
Buy binds for CS:GO
View csgo_buynds.cfg
// 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
@patrio
patrio / addkey.sh
Created Dec 21, 2012
Add public key as authorized on remote host
View addkey.sh
#!/bin/sh
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f $KEY ];then
echo "Private key not found at $KEY"
echo "* please create it with "ssh-keygen -t rsa" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
fi
@patrio
patrio / fib.js
Created Sep 24, 2012
Simple iterative way to calculate the nth number in the fibonacci sequence
View fib.js
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;
@patrio
patrio / array_inversion.js
Created Aug 24, 2012
Unreadable Array inversion counter!
View array_inversion.js
/*
* 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 = []
@patrio
patrio / gist:1817251
Created Feb 13, 2012
Find large files on linux
View gist:1817251
# Find files > 20MB
find . -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# Find directories >= 1GB
du -h . | grep ^[0-9.]*G
@patrio
patrio / index.js
Created Jan 28, 2012
Facebook Hacker Cup - Single file boilerplate
View index.js
/**
* 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
@patrio
patrio / gcd.js
Created Jan 27, 2012
JavaScript: Greatest Common Divisor
View gcd.js
// JavaScript: Greatest Common Divisor
var gcd = function (n, m) {
var r = 0;
while (n !== 0) {
r = m % n;
m = n;
n = r;
}
return m;
};
View magento-backup.py
# Automation script for: http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server
# Author: patric.nordmark@frojd.se
#
# usage: magento-backup.py [-h] -m path [-d path] [--theme theme]
# [--package package] [--db-name database]
# [--db-host hostname] [--db-user username]
# [--db-password password]
#
# Backup only the necessary Magento data for exporting a site.
#
You can’t perform that action at this time.