Skip to content

Instantly share code, notes, and snippets.

View nh2's full-sized avatar

Niklas Hambüchen nh2

View GitHub Profile
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@chrisdone
chrisdone / limit.sh
Created August 8, 2018 13:56
Set cgroup limits on a process
# Create the group
sudo cgdelete memory:/emacs # Recreating it when making changes seems to help them take effect
sudo cgcreate -g memory:/emacs -t chris:chris
sudo cgset -r memory.swappiness=0 emacs
sudo cgset -r memory.limit_in_bytes=1GB emacs
# Run the process with memory limits
cgexec -g memory:emacs emacs
@nandor
nandor / Main.hs
Last active December 29, 2015 20:19
Quadrocopter viewer
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-}
--------------------------------------------------------------------------------
-- OpenGL quadrocopter viewer
--------------------------------------------------------------------------------
module Main where
import Data.IORef
import Control.Monad
import Control.Applicative