Skip to content

Instantly share code, notes, and snippets.

#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
# 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}
# ]
% 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)
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()
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]
def average(*numbers)
((numbers.inject {|sum, element| sum + element}) / numbers.length).to_f
end
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));
(setf n 2) ;; Returnerer symbolet 'N'
N ;; returnerer 2
n ;; returnerer 2
User = new Model({
name: 'User',
adaptor: 'best',
scheme: {
username: '',
pw: ''
}
});
Note = new Model({
<html>
<body>
... Blah blah. My HTML code...
<?php include "file.txt"?>
</body>
</html>