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
--- | |
- :language: Perl | |
:user_id: sitaramc | |
:repository: gitolite | |
- :language: Perl | |
:user_id: petdance | |
:repository: ack | |
- :language: Perl | |
:user_id: rakudo | |
:repository: rakudo |
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
" MacVim meets WriteRoom. | |
if has("autocmd") | |
augroup txt | |
au! | |
autocmd GUIEnter *.txt set nolist | |
autocmd GUIEnter *.txt set columns=80 | |
autocmd GUIEnter *.txt set noruler | |
autocmd GUIEnter *.txt set nonumber | |
autocmd GUIEnter *.txt set linebreak |
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
class Array | |
def sum(identity = 0, &block) | |
return identity unless size > 0 | |
if block_given? | |
map(&block).sum | |
else | |
a = inject( nil ) { |sum,x| sum ? sum+x : x } | |
# Hack to remove the to_f error | |
a.is_a?(Array) ? a : a.to_f |
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
# -------------------------------------------------------------------- | |
# An implementation of the "Hunt and Kill" algorithm. This is fairly | |
# similar to the recursive backtracking algorithm, except that there | |
# is no recursion, and it doesn't backtrack. :) The algorithm can | |
# get a little slow towards the end, where the "hunt" phase has to | |
# search over nearly the entire field to find a candidate cell, but | |
# it's guaranteed to finish (unlike Aldous-Broder and Wilson's), and | |
# it's still pretty fast. | |
# -------------------------------------------------------------------- |
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> | |
<title>Three.js : WebGL Canvas Texture Text Example</title> | |
<style type="text/css"> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
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
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
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/ruby | |
# Github-flavored markdown to HTML, in a command-line util. | |
# | |
# $ cat README.md | ./ghmarkdown.rb | |
# | |
# Notes: | |
# | |
# You will need to install Pygments for syntax coloring | |
# | |
# $ pip install pygments |
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 'rubygems' | |
require 'redcarpet' | |
require 'pygments.rb' | |
class HTMLwithPygments < Redcarpet::Render::HTML | |
def block_code(code, language) | |
Pygments.highlight(code, :lexer => language.to_sym, :options => { | |
:encoding => 'utf-8' | |
}) |
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
val factorial = (n) => { | |
if(n < 2) 1 else (n * factorial(n - 1)); | |
}; | |
println("factorial(3) = " + factorial(3)); | |
def mkcounter(n) = () => { | |
n = n + 1; | |
n | |
}; | |
val counter = mkcounter(6); |
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
# encoding: utf-8 | |
def config | |
# in this Rakefile we can allow that | |
$config ||= Hash.new | |
end | |
# main TeX file without extension | |
config['main'] = 'YourAwesomeTex' |
OlderNewer