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 'formula' | |
class Github < Formula | |
homepage 'https://github.com/ingydotnet/git-hub' | |
url 'https://github.com/ingydotnet/git-hub/archive/perl5-advent-2013.tar.gz' | |
sha1 'd63e11687579c22e708d327245d0451c981b5904' | |
head 'https://github.com/ingydotnet/git-hub.git' | |
def install | |
system 'make' |
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
%html { | |
%head { | |
} | |
%body { | |
} | |
} |
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
#!/usr/bin/env perl6 | |
use v6; | |
grammar Simple { | |
rule TOP { | |
^ <integer> $ | |
}; | |
token integer { |
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
#!/usr/bin/env ruby | |
require "parslet" | |
require "pp" | |
class SimpleParser < Parslet::Parser | |
rule :top do | |
integer | |
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
#!/usr/bin/env perl | |
use Modern::Perl; | |
use Data::Dumper; | |
use Test::More; | |
sub hash { | |
my ($string) = shift; | |
my $hash = {}; | |
for my $c (split(//, $string)) { |
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 <stdlib.h> | |
#include <string.h> | |
char* | |
itos(int value) { | |
char* result = malloc(sizeof(char)*100); | |
sprintf(result, "%d", value); | |
return result; | |
} |
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 "mkmf" | |
$libs += " -lstdc++ " | |
create_makefile("human") |
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
(setq h (make-hash-table :test 'equal)) | |
(message "%s" h) | |
(puthash 'hello "world" h) | |
(message "%s" h) | |
(message "%s" (gethash 'hello h)) |
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
#!/usr/bin/env ruby | |
class Node | |
attr_accessor :data, :left, :right | |
def initialize(data, left = nil, right = nil) | |
@data = data | |
@left = left | |
@right = right | |
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
#!/usr/bin/env ruby | |
def hash(string) | |
hash = {} | |
string.each_char do |c| | |
hash[c] = hash[c].to_i + 1 | |
end | |
return hash | |
end |
OlderNewer