Skip to content

Instantly share code, notes, and snippets.

View amok's full-sized avatar

Max Kolodezhnyi amok

View GitHub Profile
@amok
amok / ast vs rpn.js
Last active August 29, 2015 14:03 — forked from koorchik/ast vs rpn.js
/*
There is an AST (Abstract syntax tree) in JSON format.
AST represents Excel spreadsheet formula.
Is it possible in JavaScript to make RPN (Reverse Polish Notation) faster than AST?
AST evaluation is recusive and RPN evaluation is iterative.
But in any case, AST evaluation is faster despite recursion.
I guess that the main problem is in using dynamic js arrays to emulate stack.
Would RPN win if it was written in C/C++?
#!/bin/bash
# Author: Alexander Schulz
VHOSTEN="/etc/nginx/sites-enabled/"
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]
then
echo 'Usage: n2dissite VHOST'
echo 'Disables Nginxs virtualhost VHOST.'
@amok
amok / Atheros-AR8161-install.sh
Last active October 10, 2015 07:18 — forked from chrisl8888/Atheros-AR8161-install.sh
How do I install drivers for the Atheros AR8161 Ethernet controller?
#!/bin/bash
# From: http://askubuntu.com/questions/165192/how-do-i-install-drivers-for-the-atheros-ar8161-ethernet-controller
# must be runned as root
if [ "$(id -u)" != "0" ]; then
echo "$0 must be run as root"
exit 1
fi
echo 'Rebuilding drivers for Atheros ar8161 Ethernet Controller...'