Skip to content

Instantly share code, notes, and snippets.

View damog's full-sized avatar
#neverstop

David Moreno damog

#neverstop
View GitHub Profile
@victorduwon's:
Find: '(@[a-zA-Z0-9.-]+\\)'
Replace: '<a href=\"twitter.com/:\\1\">\\1</a>'
@damog's:
Find: '@(\w+)'
Replace "<a href=\"http://twitter.com/\1\">\1</a>"
>> pf = FeedParser.parse("http://feeds.feedburner.com/digitsshowonyoutube")
ArgumentError: wrong number of arguments (1 for 0)
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/scrub.rb:201:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/scrub.rb:201:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/scrub.rb:201:in `SanitizerDoc'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/scrub.rb:208:in `sanitizeHTML'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/parser_mixin.rb:415:in `pop'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/parser_mixin.rb:475:in `popContent'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/parser_mixin.rb:1099:in `_end_description'
from /opt/local/lib/ruby/gems/1.8/gems/rfeedparser-0.9.951.1/lib/rfeedparser/parser_mixin.rb:223:in `send'
import java.util.*;
public class ArrayIterator<E> implements Iterator<E> {
private final E[] array;
private final int count;
private int cursor = 0;
public ArrayIterator(E[] contents, int ccount) {
array = contents;
class OddityTest {
public static boolean isItOdd(int i) {
return i % 2 == 1;
}
public static boolean isItReallyOdd(int i) {
return i % 2 != 0;
}
public static void main(String[] args) {
//********************************************************************
// QueueADT.java Authors: Lewis/Chase
//
// Defines the interface to a queue collection.
//********************************************************************
package jss2;
public interface QueueADT<T>
package weiss.nonstandard;
// ArrayStack class
//
// CONSTRUCTION: with no initializer
//
// ******************PUBLIC OPERATIONS*********************
// void push( x ) --> Insert x
// void pop( ) --> Remove most recently inserted item
// AnyType top( ) --> Return most recently inserted item
>> require "rubygems"
=> true
>> require "feedbag"
=> true
>> Feedbag.find "stereonaut.net"
=> ["http://stereonaut.net/feed", "http://stereonaut.net/tag/feed/", "http://stereonaut.net/comments/feed/"]
~ $ feedbag cnn.com
== cnn.com:
- http://rss.cnn.com/rss/cnn_topstories.rss
- http://rss.cnn.com/rss/cnn_latest.rss
@damog
damog / spotify-ichat.sh
Created August 11, 2011 19:23
Spotify to iChat and Adium statuses
#!/bin/bash
# shamelessly taken from: http://webcache.googleusercontent.com/search?q=cache:aUG0MH-OLaEJ:codesnippets.joyent.com/posts/show/1954+spotify+ichat&cd=1&hl=en&ct=clnk&gl=us&source=www.google.com
# messages have this format:
# 'Mon Jul 5 13:25:05 azeef-macbook GrowlHelperApp[46245] <Warning>: Spotify: Do the Buildings and Cops Make You Smile? (Bedroom Walls\nThe 4400) - Priority 0'
# which this script extracts as:
# 'Spotify: Do the Buildings and Cops Make You Smile? (Bedroom Walls'
# 'The 4400)'
# or (a little more abstract):
@damog
damog / mojo-crawler.pl
Created August 13, 2016 09:43 — forked from creaktive/mojo-crawler.pl
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue