Skip to content

Instantly share code, notes, and snippets.

View pelagisk's full-sized avatar

Axel pelagisk

View GitHub Profile
@pelagisk
pelagisk / gist:1235967
Created September 22, 2011 20:37
Funkar ej?
window.addEvent('domready',function() {
/* settings */
var showDuration = 1000;
var container = $('slideshow-container');
var divs = container.getElements('div');
var currentIndex = 0;
var interval;
/* opacity and fade */
divs.each(function(div,i){
if(i > 0) {
;;;; Skiss på tillägg till koll!
;; http://www.gnu.org/software/emacs/elisp/html_node/Change-Hooks.html#Change-Hooks
;; Author : Kristoffer Ström
;; License: public domain
;; very simple program to create a logfile of files worked on
;; can be used to keep track of work related projects for billing
;; just put this in elisp path and (require 'koll) in your config to have a go.
291 cd /var/env/prekariatet/src/Prekariatet/
292 emacs static/css/style.css
293 cd ../../
294 source bin/activate
295 cd src/Prekariatet/
296 ls -al
297 gunicorn_django
298 emacs prekariatet/admin.py
299 sudo emacs prekariatet/admin.py
300 gunicorn_django
@pelagisk
pelagisk / gist:2311852
Created April 5, 2012 15:11
Vim-cute-python adaptation for emacs?
(defun cute-python ()
(interactive)
(remove-overlays)
(let (
(strings '(
(" != " . " ≢ ")
(" in " . " ∈ ")
(" or " . " ∨ ")
(" and " . " ∧ ")
(" is not " . " ¬ ")
@pelagisk
pelagisk / gist:2980417
Created June 23, 2012 22:47
Towers of hanoi
#/usr/bin/env/python
""" towers of hanoi
There is a legend about an Indian temple which contains a large room
with three time-worn posts in it surrounded by 64 golden
disks. Brahmin priests, acting out the command of an ancient prophecy,
have been moving these disks, in accordance with the rules of the
puzzle, since that time. The puzzle is therefore also known as the
Tower of Brahma puzzle. According to the legend, when the last move of
@pelagisk
pelagisk / gist:2984621
Created June 24, 2012 19:31
Towers of hanoi - iterative
#/usr/bin/env/python
""" towers of hanoi
There is a legend about an Indian temple which contains a large room
with three time-worn posts in it surrounded by 64 golden
disks. Brahmin priests, acting out the command of an ancient prophecy,
have been moving these disks, in accordance with the rules of the
puzzle, since that time. The puzzle is therefore also known as the
Tower of Brahma puzzle. According to the legend, when the last move of
@pelagisk
pelagisk / gist:3102097
Created July 13, 2012 00:58
Exempel CSS
/* så här här skriver du en kommentar */
body {
background-color: #ffffff;
}
h1 {
font-family: "Helvetica", sans-serif;
font-color: #ff0000;
}
@pelagisk
pelagisk / gist:3102122
Created July 13, 2012 01:09
Exempel HTML
<html>
<head>
<title>Skriv en titel här</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<section id="ett-textblock">
<h1>En rubrik</h1>
<p>Brödtext hamnar här</p>
<a href="http://motkraft.net">Länk till motkraft.net</a>
@pelagisk
pelagisk / gist:3294492
Created August 8, 2012 11:52
Exempel 1 The Loop
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
?>
@pelagisk
pelagisk / gist:3294510
Created August 8, 2012 11:55
Exempel 2 The Loop
<?php
$banners = get_posts('post_status=publish&orderby=post_date&numberposts=10');
foreach( $banners as $idx => $post ) {
setup_postdata($post);
the_title();
the_content();
}
?>