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
Mark Holmberg, Dixie State College of Utah | |
CS 3520, Programming Languages | |
14 Sept. 2011 | |
(defn foldl [f sofar lst] | |
(if (empty? lst) sofar | |
(foldl f(f (first lst) sofar) (rest lst)))) | |
(defn foldr [f sofar lst] |
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
#to find the offenders | |
find -name "*\.php" -print0 | xargs -0 grep -Rin "password" > results.txt | |
# to replace it with garbage | |
find . -name "*.php" -print0 | xargs -0 sed -i -e 's/FINDME/REPLACEWITHME/g' | |
# you can change '*.php' to the extension you want. | |
# remove the command from .bash_history | |
> ~/.bash_history |
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
#TODO: Match the optional ".x86" extension | |
grep -Rin --after-context 1 "all:" $(find -type f -iname "Makefile") | grep -Rin "\-o\ \b\w\+-\?\w\+-\?\w\+\?\?\b" |
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
#!/bin/bash | |
agent=SIMPLETON | |
port=31656 | |
trace=1 | |
SLEEP=10 | |
steps=150 | |
seed=1257360045 | |
./RunProg ./WW_Test -p ${port} -d 0 -D 1 -R 1 -s ${steps} -t 0 -S ${SLEEP} -z {seed} & |
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 ActionView::Template | |
class Markdown | |
def call(template) | |
Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(template.source).inspect | |
end | |
end | |
ActionView::Template.register_template_handler :md, Markdown.new | |
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
#!/bin/sh - | |
mvim -d -f "$2" "$5" |
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
# Force SSL | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
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
Article.published.each do |k| | |
new_published = rand(5.months.ago..Time.now) | |
k.update_attribute(:published_at, new_published) | |
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
countries = [ | |
["AF", "Afghanistan"], | |
["AL", "Albania"], | |
["DZ", "Algeria"], | |
["AS", "American Samoa"], | |
["AD", "Andorra"], | |
["AO", "Angola"], | |
["AI", "Anguilla"], | |
["AQ", "Antarctica"], | |
["AG", "Antigua and Barbuda"], |
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
@import "twitter/bootstrap/bootstrap"; | |
body { | |
padding-top: 60px; | |
} | |
@import "twitter/bootstrap/responsive"; | |
// Set the correct sprite paths | |
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png'); | |
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png'); |