Skip to content

Instantly share code, notes, and snippets.

Avatar

Niklas Hambüchen nh2

View GitHub Profile
@chrisdone
chrisdone / limit.sh
Created Aug 8, 2018
Set cgroup limits on a process
View limit.sh
# 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 Dec 29, 2015
Quadrocopter viewer
View Main.hs
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-}
--------------------------------------------------------------------------------
-- OpenGL quadrocopter viewer
--------------------------------------------------------------------------------
module Main where
import Data.IORef
import Control.Monad
import Control.Applicative
@joelnet
joelnet / example.html
Created Jun 3, 2011
Unobtrusive Knockout support library for jQuery
View example.html
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}}
You can’t perform that action at this time.