Skip to content

Instantly share code, notes, and snippets.

buff = ""
File.open('1.txt', 'r').each_line do |line|
if line =~ /^----- /i && buff != ""
puts "--> " + buff
puts "[ " + tags.join(", ") + " ]"
while rline= gets do
tag= rline.chomp!
print "--> " + tag
break if tags.include?(tag)
print " not okay.\n"
def can_haz_link?(link)
(/^\//.match(link) || Regexp.compile("^"+@base).match(link)) && !@collection.include?(link)
end
"if has("gui_running")
" function! GuiTabLabel()
" let label = ''
" let bufnrlist = tabpagebuflist(v:lnum)
" let bufname = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
" let has_changes = 0
" for bufnr in bufnrlist
" if getbufvar(bufnr, "&modified")
" let has_changes = 1
Index: templates/photo_view.html
===================================================================
--- templates/photo_view.html (revision 11)
+++ templates/photo_view.html (working copy)
@@ -20,7 +20,7 @@
<a href="{{ photo.get_previous_by_date.get_url }}" title="(click for previous image)">
{% endif %}
<img id="image" src="{{ photo.get_file_url }}" alt="" />
- {% if photo.get_previous_by_date.get_absolute_url %}
+ {% if photo.get_previous_by_date %}
@aurelian
aurelian / md5.c
Created September 10, 2008 09:58
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
// gcc -lssl md5.c -o md5
int main(int argc, char *argv[]) {
unsigned char buffer[1024];
int i;
unsigned char digest[16];
@aurelian
aurelian / rextend.c
Created September 12, 2008 13:13
2 functions to extend gawk with
/*
* rextend.c - 2 functions to extend gawk
*
* Aurelian Oancea, aurelian at locknet [dot] ro
*/
/*
* Copyright (C) 2008 Aurelian Oancea
*
* This program is free software: you can redistribute it and/or modify
---
-
- - o
- a
- m
- l
- i
- v
- s
- e
[aurelian@birmingham shell-fm]$ shell-fm
Shell.FM v0.6, (C) 2006-2008 by Jonas Kramer
Published under the terms of the GNU General Public License (GPL).
Press ? for help.
Login: XXX
Password:
radio url> /listen/artist/Tiamat/similarartists
Receiving Tiamat Radio.
<?php
$sxe= simplexml_load_file( RSS_FILE );
foreach($sxe->channel->item as $item) {
list($lat, $long)= explode(" ", trim($item->children('http://www.georss.org/georss')->point));
echo " * %". ucwords($item->title) . "% { :latitude => " . $lat . ", :longitude => " . $long . " } \n";
}
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.response.out.write("""
<html>
<body>
<form action="/q1.html" method="post">