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
(eval-after-load 'org | |
'(progn | |
(set-face-foreground 'org-level-2 "magenta4") | |
(set-face-foreground 'outline-2 "magenta4") | |
(set-face-foreground 'org-level-6 "red3") | |
(set-face-foreground 'outline-6 "red3"))) |
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
;; A palindromic number reads the same both ways. The largest palindrome made | |
;; from the product of two 2-digit numbers is 9009 = 91 × 99. | |
;; | |
;; Find the largest palindrome made from the product of two 3-digit numbers. | |
;; | |
(defun array-reverse (array) | |
"Reverse the ARRAY." | |
(let ((reversed-array (copy-sequence array)) | |
(array-length (length array)) |
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
/** | |
* SiteFocus, an enhanced version of the Blacklist Sites - Page Mods Demo. | |
* Recommended for anyone who has this problem: http://xkcd.com/477/ | |
* Martin Owen - [email protected] | |
*/ | |
jetpack.future.import("storage.simple"); | |
jetpack.future.import('menu'); | |
function SiteFocus() { |
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
/** | |
* This stylesheet will work pretty well with a regular Org Mode HTML export. | |
* However, you do have to turn off all of the defaults: | |
* | |
* (setq org-export-html-style-include-scripts nil | |
* org-export-html-style-include-default nil) | |
* | |
* and insert a call to the stylesheet: | |
* | |
* (setq org-export-html-style |
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
(ns martin) | |
(defn sqr | |
"Square the given number." | |
[n] | |
(. (BigInteger/valueOf n) (pow 2))) | |
(defn euler-6 | |
"Find the difference between the sum of the squares of the first one hundred | |
natural numbers and the square of the sum." |
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
(ns martin) | |
(defn evenly-divisible? | |
"Is N evenly-divisible by all of the numbers in SEQ?" | |
[n seq] | |
(loop [s seq] | |
;; TODO: Find out how to do 'cond' in Clojure | |
(if (empty? s) | |
true | |
(if (not (zero? (mod n (first s)))) |
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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>jQuery Prototype</title> | |
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" rel="stylesheet" /> | |
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.2.custom/js/jquery-1.4.2.min.js"></script> | |
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.2.custom/js/jquery-ui-1.8.2.custom.min.js"></script> | |
<script type="text/javascript" language="javascript" src="nassi-shneiderman.js"></script> | |
<style type="text/css"> | |
.block { border: 1px solid #000; text-align: center; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Experiments | |
{ | |
public class BadService : IService | |
{ | |
public string ProvideService() |
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
// Method for converting a Json.NET object into a dynamic CLR object. | |
// http://groups.google.com/group/mongodb-csharp/browse_thread/thread/ef1308f38bdbde3e | |
public static class DynamicUtils | |
{ | |
public static object ConvertJTokenToObject(JToken token) | |
{ | |
if (token is JValue) | |
{ | |
return ((JValue)token).Value; | |
} |
OlderNewer