This file contains hidden or 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
#On branch search | |
$ git checkout -b TEMP-search | |
Switched to a new branch 'TEMP-search' | |
$ git fetch http://github.com/Sirupsen/gollum.git search | |
got 7ab77dbde50779f13e7b3eddad719d1fcb345e0b | |
... | |
got 144d612dd6563f71319e63b3dc5726ed9102be1c |
This file contains hidden or 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
# Searching with the Gollum search API | |
wiki = Gollum::Wiki.new(path) | |
results = wiki.search "Foo Bar" | |
# results = [ | |
# {name: "foo" , count: 9001}, | |
# {name: "bar" , count: 42} | |
# ] |
This file contains hidden or 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
% Must include pstricks and pst-node | |
Find $x$. | |
% Here we add a node, we're going to use it later | |
Down \rnode{here}{here} | |
\begin{pspicture}(5,4) | |
% First we draw the triangle shape (It can probably be done in a much smarter way) | |
\psline(0,0)(4,0) |
This file contains hidden or 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
from test import Test | |
square = lambda x: x**2 | |
squareTest = Test(square) | |
squareTest.addTests(([2], 2*2), | |
([3], 3*3), | |
([1000], 1000*1000)) | |
squareTest.run() |
This file contains hidden or 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
Encrypt: (message, m, E) -> | |
for n in message | |
(Math.pow n, E) % m | |
Decrypt: (message, m, D) -> | |
for n in message | |
(Math.pow n, D) % m | |
message:[4,5,7,8,4,2,2,4,6,8,9] |
This file contains hidden or 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
def average(*numbers) | |
((numbers.inject {|sum, element| sum + element}) / numbers.length).to_f | |
end |
This file contains hidden or 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
background-image: | |
-webkit-gradient(linear, left bottom, left top, | |
color-stop(0, #ff0000), | |
color-stop(0.166667, #ff00ff), | |
color-stop(0.333333, #0000ff), | |
color-stop(0.5, #00ffff), | |
color-stop(0.666667, #00ff00), | |
color-stop(0.833333, #ffff00), | |
color-stop(1, #ff0000)); |
This file contains hidden or 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
(setf n 2) ;; Returnerer symbolet 'N' | |
N ;; returnerer 2 | |
n ;; returnerer 2 |
This file contains hidden or 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
User = new Model({ | |
name: 'User', | |
adaptor: 'best', | |
scheme: { | |
username: '', | |
pw: '' | |
} | |
}); | |
Note = new Model({ |
This file contains hidden or 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> | |
<body> | |
... Blah blah. My HTML code... | |
<?php include "file.txt"?> | |
</body> | |
</html> |