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
# coding=utf-8 | |
""" | |
Simpel twittersøker skrevet i python | |
""" | |
from sys import stdin | |
from urllib import urlencode | |
import urllib2 | |
import simplejson |
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
" window movement | |
no <C-L> <C-W>l | |
no <C-H> <C-W>h | |
no <C-J> <C-W>j | |
no <C-K> <C-W>k |
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
JAVA_HOME="/usr/lib/jvm/java-6-sun" | |
export JAVA_HOME |
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
# -*- coding: utf-8 -*- | |
""" | |
Copyright 2012 Sigurd Fosseng | |
You can do whatever you want with this stuff. If we meet some day, and | |
you think this stuff is worth it, you can buy me a beer or a coffee in | |
return. | |
Description: | |
Exports Spotify playlists that you own to *.xspf. |
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
(ncr(7,4) * (ncr(3,1) * ncr(24,2) + ncr(3,2) * ncr(24,1) + 1))/ncr(34,7) |
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
#!/usr/bin/env python | |
har_ordet = 1 | |
partiledere = ["Erna", "Jens"] | |
while(True): | |
print partiledere[har_ordet % 2] + ": NEI NEI NEI, dette er fakta." | |
har_ordet += 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
#encoding=utf-8 | |
from django.core.mail import send_mail as djsend_mail | |
from django.template.loader import get_template | |
from django.template import Context | |
#>>> util.send_mail('events/index.html', "lol", "fra", "til", {'events': "dette er events"}) | |
def send_mail(template, subject, fra , to, context): | |
if(isinstance(to, str)): # to can be both a list of strings or a string. |
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
import sys | |
map(lambda x: sys.stdout.write( x + "\n"), ["fizzbuzz" if not x % 15 else ("fizz" if not x % 3 else ("buzz" if not x % 5 else str(x))) for x in range(1, 101)]) |
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
<script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.2.1/platform.js"></script> | |
<x-foo red></x-foo> | |
<template id="foo"> | |
<style> | |
:host[red] {background-color: red;} | |
</style> | |
foo | |
</template> |
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
<html> | |
<head> | |
<link rel="import" href="x-foo.html"> | |
</head> | |
<body> | |
<x-foo></x-foo> | |
</body> | |
</html> |