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> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | |
| <script src="jquery.masonry.min.js"></script> | |
| <script type="text/javascript"> | |
| $(function(){ | |
| $('body').masonry({ | |
| itemSelector: 'img', | |
| columnWidth: 500, | |
| }); |
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
| def foo(val): | |
| """ | |
| >>> foo(0) | |
| 2 | |
| >>> foo(1) | |
| Traceback (most recent call last): | |
| ... | |
| ValueError: 1 | |
| """ | |
| if val == 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
| #!/bin/bash | |
| set -e | |
| # Simple script for getting and installing latest openttd with opengfx and opensfx | |
| # Downloads latest trunk version by default, but if you supply the revision you want | |
| # as the first argument, it downloads that version. | |
| # | |
| # Examples: | |
| # |
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/perl | |
| use strict; | |
| use utf8; | |
| open(COMMANDS, '>>cmds.sh'); | |
| for my $movie (<./*>){ | |
| print "Analyzing $movie..\n"; |
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/perl | |
| use strict; | |
| use LWP::UserAgent; | |
| use HTTP::Request; | |
| my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, ); | |
| my $data_to_send;#-- And build a string of it |
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
| ! Billig::Economy::Settlement | |
| Denne noden forklarer de forskjellige aspektene av Billig sin støtte for å håndtere kasseoppgjør. | |
| !! Databasen | |
| Lagringen av kasseoppgjør gjøre etter skjemaet som finnes i sql/settlement.sql | |
| i kode-treet. | |
| Et kasseoppgjør har et starttidspunkt og et slutttidspunkt som viser når |
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
| # Needs seperate compiles updaters for now.. | |
| python -c "import lxml.html; import urllib; print '\n'.join([a.values()[0] for a in lxml.html.document_fromstring(urllib.urlopen('http://spotify.erlang.no').read()).cssselect('#p3')[0].cssselect('a')])" > p3.pls | |
| python -c "import lxml.html; import urllib; print '\n'.join([a.values()[0] for a in lxml.html.document_fromstring(urllib.urlopen('http://spotify.erlang.no').read()).cssselect('#mpetre')[0].cssselect('a')])" > mp3.pls | |
| python -c "import lxml.html; import urllib; print '\n'.join([a.values()[0] for a in lxml.html.document_fromstring(urllib.urlopen('http://spotify.erlang.no').read()).cssselect('#vglista')[0].cssselect('a')])" > vg.pls | |
| python -c "import lxml.html; import urllib; print '\n'.join([a.values()[0] for a in lxml.html.document_fromstring(urllib.urlopen('http://spotify.erlang.no').read()).cssselect('#radio1')[0].cssselect('a')])" > radio1.pls | |
| ./updater-p3 username pass | |
| ./updater-mp3 username pass | |
| ./updater-vg username pass |
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 perl | |
| use strict; | |
| our $temp = "foobar"; | |
| sub foo { | |
| our $temp = "bar"; | |
| return "bar"; |
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
| def unpack_string(octet_string): | |
| ret = [] | |
| for hex in octet_string.split(' '): | |
| octets = struct.unpack('2c', hex) | |
| for octet in octets: | |
| b_repr = bin(int(octet, 16)).replace('b','') | |
| ret.append( b_repr.ljust(4, '0')) | |
| return [b[0]+1 for b in enumerate([a for a in "".join(ret)]) if b[1] == '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
| import re | |
| LAN_REGEXP = re.compile('^([\w-]+),([\w-]+),?([\w-]+)?,?(\d+)?$') | |
| CORE_REGEXP = LAN_REGEXP | |
| ELINK_REGEXP = LAN_REGEXP | |
| LINK_REGEXP = re.compile('^([\w-]+),?([\w-]+)?,?(\d+)?$') | |
| def parse_ifDescr(ifDescr): | |
| type = ifDescr[:ifDescr.find(',')] | |
| print type |
NewerOlder