This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Oppgave | |
| ======= | |
| Når et innlegg stemmes på: | |
| 1. oppdater "hot scoren" i tittel attributtet | |
| 2. sorter listen på ny | |
| Dette skal gjøres på klientsiden, ingen kommunikasjon over HTTP er lov. | |
| Steg: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from calendar import LocaleHTMLCalendar | |
| from datetime import date | |
| from itertools import groupby | |
| from django.utils.html import conditional_escape as esc | |
| class WorkoutCalendar(LocaleHTMLCalendar): | |
| def __init__(self, workouts, locale): | |
| super(WorkoutCalendar, self).__init__(locale=locale) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################################### | |
| # sysinfo | |
| ########################################################### | |
| # uname -nrmo | |
| stormondemand.test 2.6.18-128.1.14.el5 x86_64 GNU/Linux | |
| # grep "MemTotal" /proc/meminfo | |
| MemTotal: 1758232 kB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Return keys with a given prefix for a particular node where there are a | |
| -- known total of nodes. Uses the reamainder of the keys' hash values to | |
| -- segment the keys. | |
| function slice(prefix, index_and_total) | |
| local args = _split(index_and_total, "\t") | |
| if #args ~= 2 then | |
| return nil | |
| end | |
| local index = tonumber(args[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Should return "it works!" for all inputs | |
| function is_it_working(key, value) | |
| return "it works!" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * matchMedia() polyfill - test whether a CSS media type or media query applies | |
| * primary author: Scott Jehl | |
| * Copyright (c) 2010 Filament Group, Inc | |
| * MIT license | |
| * adapted by Paul Irish to use the matchMedia API | |
| * http://dev.w3.org/csswg/cssom-view/#dom-window-matchmedia | |
| * which webkit now supports: http://trac.webkit.org/changeset/72552 | |
| * | |
| * Doesn't implement media.type as there's no way for crossbrowser property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # <udf name="fqdn" label="Fully qualified domain name" /> | |
| PUBLIC_IP_ADDRESS=`ifconfig eth0 | awk -F':' '/inet addr/{split($2,_," ");print _[1]}'` | |
| echo $FQDN > /etc/hostname && hostname -F /etc/hostname | |
| echo $PUBLIC_IP_ADDRESS `hostname` `hostname -s` >> /etc/hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node "helium.uggedal.com" inherits servernode { | |
| include europe | |
| hostname { "helium.uggedal.com": | |
| aliases => ["helium", "he"], | |
| } | |
| include sshserver::web | |
| include webserver | |
| include sqlserver | |
| include postgresql::python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| base: | |
| 'web1': | |
| - nginx: | |
| - hostname: www.uggedal.com | |
| 'web1': | |
| - nginx: | |
| - hostname: blog.uggedal.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var page = require('webpage').create(); | |
| if (phantom.args.length !== 5) { | |
| console.log('Usage: rasterize.js URL filename width height delay'); | |
| phantom.exit(); | |
| } else { | |
| var address = phantom.args[0], | |
| output = phantom.args[1], | |
| width = parseInt(phantom.args[2]), | |
| height = parseInt(phantom.args[3]), |