This file contains 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
require 'sinatra' | |
require 'haml' | |
require 'hpricot' | |
require 'open-uri' | |
require 'RMagick' | |
get '/' do | |
haml :index | |
end |
This file contains 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
require 'isaac' | |
require 'nokogiri' | |
require 'open-uri' | |
page = Nokogiri(open("http://listverse.com/2007/10/08/40-quotes-of-oscar-wilde/")) | |
quotes = page.css(".post-content p").find_all do |line| | |
('1'..'9').include? line.text[0] | |
end | |
quotes.map! do |quote| |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Sierpinski Triangle</title> | |
<script src="sierpinski.js"></script> | |
</head> | |
<body> | |
<h1>Sierpinski Triangle</h1> | |
<canvas width="500" height="500"></canvas> |
This file contains 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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
void wheel(char name[]) | |
{ | |
char *track = malloc(strlen(name)); | |
int i, ii; | |
for (i = 0, ii = strlen(name) + 1; i < ii; i++) { | |
printf("%s:wheel:%s\n", track, name); |
This file contains 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
#ifndef __color_h__ | |
#define __color_h__ | |
/* | |
* I got some of the colour codes (as well as having the idea of putting them in a macro) from here: | |
* http://stackoverflow.com/questions/3506504/c-code-changes-terminal-text-color-how-to-restore-defaults-linux | |
*/ | |
#define RED "\e[31m" | |
#define GREEN "\e[32m" |
This file contains 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
Options +FollowSymlinks | |
RewriteEngine on | |
RewriteBase /fosdem/ | |
RewriteRule ^(.*) index.php?rewrit |
This file contains 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
var Matrix = function (rows, cols, bombs, rupoors) { | |
var i, j; | |
this.grid = []; | |
this.rows = rows; | |
this.cols = cols; | |
this.bombs = bombs; | |
this.rupoors = rupoors; | |
this.leftToDig = (rows * cols) - (bombs + rupoors); | |
// fill Matrix with empty holes... |
This file contains 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
body { | |
background: #CCC; | |
} | |
h1 { | |
margin: 0; | |
} | |
#main { | |
min-width: 340px; |
This file contains 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
<snippet> | |
<content><![CDATA[ | |
""" | |
:MI 8M: | |
DMMM. MMMM. | |
.MMM. .MMM | |
MM, IMM | |
8MM MMM |
This file contains 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
use strict; | |
use vars qw($VERSION %IRSSI); | |
use URI::Escape; | |
use Irssi qw(command_bind signal_add); | |
sub same { | |
my ($server, $msg, $nick, $address, $channel) = @_; | |
if($msg =~ /^same$/) { | |
$server->command("msg $channel same") if ($channel); |
OlderNewer