Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: crdx/crdx.org
base: fa2d8c10a6
...
head fork: crdx/crdx.org
compare: 51514840f4
  • 10 commits
  • 15 files changed
  • 0 commit comments
  • 1 contributor
View
3  .gitignore
@@ -1 +1,2 @@
-_posts/
+_posts/
+node_modules/
View
66 Gruntfile.js
@@ -0,0 +1,66 @@
+module.exports = function(grunt) {
+ grunt.loadNpmTasks("grunt-contrib-less");
+ grunt.loadNpmTasks("grunt-contrib-watch");
+ grunt.loadNpmTasks("grunt-contrib-jshint");
+ grunt.loadNpmTasks("grunt-shell");
+
+ grunt.initConfig({
+ pkg: grunt.file.readJSON("package.json"),
+
+ less: {
+ dist: {
+ files: {
+ "css/style.css": "css/style.less" /* out: in */
+ },
+ },
+ },
+
+ watch: {
+ files: ["**/*", "!node_modules/**/*"],
+ tasks: ["jshint", "less:dist", "jekyll"]
+ },
+
+ jshint: {
+ Gruntfile: {
+ options: {
+ es5: true,
+ },
+ files: {
+ src: ["Gruntfile.js"],
+ },
+ },
+
+ js: {
+ options: {
+ laxbreak: true
+ },
+ files: {
+ src: ["js/{my,github-commits,cookie-generator,analytics}.js"]
+ },
+ },
+ },
+ });
+
+ grunt.registerTask("jekyll", "generates jekyll", function() {
+ var done = this.async();
+
+ grunt.util.spawn({ cmd: "jekyll" }, function(error, result, code) {
+ if (error)
+ {
+ grunt.log.error(error);
+ done(false);
+ }
+ else
+ {
+ grunt.log.writeln(result);
+ done(true);
+ }
+ });
+ });
+
+ grunt.registerTask("deploy", function() {
+
+ });
+
+ grunt.registerTask("default", ["watch"]);
+};
View
4 _config.yml
@@ -4,10 +4,10 @@ title: "crdx.org"
permalink: "/:year/:month/:day/:title.html"
paginate: 10
-destination: "../crdx.org-deploy/deploy"
+destination: "../dist/deploy"
pygments: true
markdown: "rdiscount"
lsi: false
future: false
-exclude: [ "README.md" ]
+exclude: ["README.md", "Gruntfile.js", "package.json", "node_modules"]
View
6 _deploy
@@ -1,6 +0,0 @@
-jekyll
-cd ../crdx.org-deploy
-git add .
-git add -u
-git commit -m "deploy"
-git push
View
101 _includes/code.js
@@ -1,101 +0,0 @@
-var repositories = [
- { id: "crdx_org", repoName: "crdx.org" },
- { id: "markdowns", repoName: "markdowns" },
- { id: "demunger", repoName: "demunger" },
- { id: "tile", repoName: "Tile" },
- { id: "calc", repoName: "Calc" },
- { id: "portablesettingsprovider", repoName: "PortableSettingsProvider" },
- { id: "graph", repoName: "Graph" },
- { id: "trivia_mrc", repoName: "trivia-mrc" },
- { id: "utorrent_mrc", repoName: "utorrent-mrc" }
-];
-
-var url = "https://api.github.com/repos/crdx/0/commits";
-
-function getTooltip(commit)
-{
- var toolTip = "[" + commit.tree.sha.substring(0, 6) + "] "
- + commit.message
- + "<br><br>(by " + commit.committer.name + " "
- + timeAgo(commit.committer.date);
-
- if (commit.committer.name !== commit.author.name)
- toolTip += " and authored by " + commit.author.name;
-
- return toolTip + ")";
-}
-
-function setTooltip($element, msg)
-{
- $element
- .attr('title', msg)
- .tooltip('fixTitle')
- .tooltip('show');
-}
-
-$(function() {
- $.each(repositories, function(i, element) {
- $("#" + element.id).css("cursor", "default");
-
- $("#" + element.id + " b").tooltip({
- html: true,
- animation: false,
- trigger: "manual",
- placement: "right"
- });
-
- var mouseEnter = function()
- {
- var $this = $(this);
-
- // if it's in the cache, just show and quit
- if ($this.data("commit"))
- {
- setTooltip($this, $this.data("commit"));
- $this.tooltip("show");
- return;
- }
-
- // not in the cache, so show the 'loading' tooltip
- setTooltip($this, "<i class='w-glyphicon-clock'></i> Loading...");
- $this.tooltip("show");
- $this.data("cancel", false); // reset cancelled flag
-
- var repoUrl = url.replace(/0/, element.repoName);
-
- $.ajax({ dataType: "jsonp", url: repoUrl, success: function(result) {
- var tooltipMsg;
-
- if (result.data[0])
- {
- tooltipMsg = getTooltip(result.data[0].commit);
-
- $this.data("commit", tooltipMsg);
- }
- else
- {
- tooltipMsg = "unable to get commit"
-
- if (result.data.message)
- tooltipMsg += ": " + result.data.message;
- }
-
- // only show it if it hasn't been cancelled
- if ($this.data("cancel") !== true)
- setTooltip($this, tooltipMsg);
- }});
- };
-
- var mouseLeave = function()
- {
- var $this = $(this);
-
- // hide the tooltip, and cancel any future tooltip-showing operations
- $this.tooltip("hide");
- $this.data("cancel", true);
- };
-
- // tooltips on <td>s make everything jump around, so use the <b>
- $("#" + element.id + " b").hover(mouseEnter, mouseLeave);
- });
-});
View
22 _includes/cookies.js
@@ -1,22 +0,0 @@
-$(function() {
- $("#generate").on("click", function(e) {
- var prefix = "." + $("#domain").val() + "\tTRUE\t/\tFALSE\t" + parseInt((new Date()).getTime() / 1000 + 2592000, 10) + "\t"; // 1 month?
- var segments = $("#input").val().split(";");
- var output = "";
-
- for (var i = 0; i < segments.length; i++)
- {
- var segment = $.trim(segments[i]).split("=", 2);
-
- if (segment.length < 2)
- continue;
-
- output += prefix + segment[0] + "\t " + segment[1] + "\n";
- }
-
- $("#output").val(output);
- return false;
- });
-
- $("#output").on("click", function() { $(this).select(); });
-});
View
16 _includes/disqus.html
@@ -1,13 +1,13 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
- var disqus_shortname = "crdx";
- var disqus_url = "{{ site.url }}{{ page.url }}";
- var disqus_identifier = "{{ page.disqus_id }}";
+ var disqus_shortname = "crdx";
+ var disqus_url = "{{ site.url }}{{ page.url }}";
+ var disqus_identifier = "{{ page.disqus_id }}";
- (function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments.</a></noscript>
View
22 code.html
@@ -6,9 +6,7 @@
title: code
---
-<script type="text/javascript">
- {% include code.js %}
-</script>
+<script type="text/javascript" src="/js/github-commits.js"></script>
<h3 class="underline">{{ page.title }}</h3>
@@ -21,55 +19,55 @@ <h3 class="underline">{{ page.title }}</h3>
<table class="table table-condensed">
<tbody>
<tr>
- <td id="crdx_org"><b class="text-warning">active</b></td>
+ <td class="project" data-repo="crdx.org"><b class="text-warning">active</b></td>
<td><a href="https://github.com/crdx/crdx.org">crdx.org</a></td>
<td>mixed</td>
<td>this website</td>
</tr>
<tr>
- <td id="markdowns"><b class="text-success">done</b></td>
+ <td class="project" data-repo="markdowns"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/markdowns">markdowns</a></td>
<td>js</td>
<td>node.js application that watches and converts Markdown files into HTML files</td>
</tr>
<tr>
- <td id="demunger"><b class="text-success">done</b></td>
+ <td class="project" data-repo="demunger"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/demunger">demunger</a></td>
<td>js</td>
<td>jQuery plugin that transparently demunges common email address munging techniques</td>
</tr>
<tr>
- <td id="tile"><b class="text-success">done</b></td>
+ <td class="project" data-repo="Tile"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/Tile">Tile</a></td>
<td>js</td>
<td>game</td>
</tr>
<tr>
- <td id="calc"><b class="text-success">done</b></td>
+ <td class="project" data-repo="Calc"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/Calc">Calc</a></td>
<td>C#</td>
<td>set values to variables, and use them in calculations</td>
</tr>
<tr>
- <td id="portablesettingsprovider"><b class="text-success">done</b></td>
+ <td class="project" data-repo="PortableSettingsProvider"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/PortableSettingsProvider">PortableSettingsProvider</a></td>
<td>C#</td>
<td>an implementation of SettingsProvider for portable applications</td>
</tr>
<tr>
- <td id="graph"><b class="text-success">done</b></td>
+ <td class="project" data-repo="Graph"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/Graph">Graph</a></td>
<td>C#</td>
<td>simple graph-drawing API</td>
</tr>
<tr>
- <td id="trivia_mrc"><b class="text-success">done</b></td>
+ <td class="project" data-repo="trivia-mrc"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/trivia-mrc">trivia-mrc</a></td>
<td>mIRC script</td>
<td>a trivia bot</td>
</tr>
<tr>
- <td id="utorrent_mrc"><b class="text-success">done</b></td>
+ <td class="project" data-repo="utorrent-mrc"><b class="text-success">done</b></td>
<td><a href="https://github.com/crdx/utorrent-mrc">utorrent-mrc</a></td>
<td>mIRC script</td>
<td>retrieve information from the uTorrent WebUI</td>
View
8 index.html
@@ -14,10 +14,10 @@
var disqus_identifier = "{{ page.disqus_id }}";
(function () {
- var s = document.createElement('script'); s.async = true;
- s.type = 'text/javascript';
- s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
- (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
+ var s = document.createElement('script'); s.async = true;
+ s.type = 'text/javascript';
+ s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
}());
</script>
View
6 js/analytics.js
@@ -3,7 +3,7 @@ _gaq.push(['_setAccount', 'UA-35469939-3']);
_gaq.push(['_trackPageview']);
(function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
View
24 js/cookie-generator.js
@@ -0,0 +1,24 @@
+$(function() {
+ $("#generate").on("click", function(event) {
+ var prefix = "." + $("#domain").val() + "\tTRUE\t/\tFALSE\t" + parseInt((new Date()).getTime() / 1000 + 2592000, 10) + "\t"; // 1 month?
+ var segments = $("#input").val().split(";");
+ var output = "";
+
+ for (var i = 0; i < segments.length; i++)
+ {
+ var segment = $.trim(segments[i]).split("=", 2);
+
+ if (segment.length < 2)
+ continue;
+
+ output += prefix + segment[0] + "\t " + segment[1] + "\n";
+ }
+
+ $("#output").val(output);
+ return false;
+ });
+
+ $("#output").on("click", function(event) {
+ $(this).select();
+ });
+});
View
92 js/github-commits.js
@@ -0,0 +1,92 @@
+(function() {
+ var url = "https://api.github.com/repos/crdx/0/commits";
+
+ function getTooltip(commit)
+ {
+ var toolTip = "[" + commit.tree.sha.substring(0, 6) + "] "
+ + commit.message
+ + "<br><br>(by " + commit.committer.name + " "
+ + timeAgo(commit.committer.date);
+
+ if (commit.committer.name !== commit.author.name)
+ toolTip += " and authored by " + commit.author.name;
+
+ return toolTip + ")";
+ }
+
+ function setTooltip($element, msg)
+ {
+ $element
+ .attr('title', msg)
+ .tooltip('fixTitle')
+ .tooltip('show');
+ }
+
+ $(function() {
+ $(".project").each(function(i, element) {
+ var $element = $(element);
+ $element.css("cursor", "default");
+
+ $("b", $element).tooltip({
+ html: true,
+ animation: false,
+ trigger: "manual",
+ placement: "right"
+ });
+
+ var mouseEnter = function()
+ {
+ var $this = $(this);
+
+ // if it's in the cache, just show and quit
+ if ($this.data("commit"))
+ {
+ setTooltip($this, $this.data("commit"));
+ $this.tooltip("show");
+ return;
+ }
+
+ // not in the cache, so show the 'loading' tooltip
+ setTooltip($this, "<i class='w-glyphicon-clock'></i> Loading...");
+ $this.tooltip("show");
+ $this.data("cancel", false); // reset cancelled flag
+
+ var repoUrl = url.replace(/0/, $element.data("repo"));
+
+ $.ajax({ dataType: "jsonp", url: repoUrl, success: function(result) {
+ var tooltipMsg;
+
+ if (result.data[0])
+ {
+ tooltipMsg = getTooltip(result.data[0].commit);
+
+ $this.data("commit", tooltipMsg);
+ }
+ else
+ {
+ tooltipMsg = "unable to get commit";
+
+ if (result.data.message)
+ tooltipMsg += ": " + result.data.message;
+ }
+
+ // only show it if it hasn't been cancelled
+ if (!$this.data("cancel"))
+ setTooltip($this, tooltipMsg);
+ }});
+ };
+
+ var mouseLeave = function()
+ {
+ var $this = $(this);
+
+ // hide the tooltip, and cancel any future tooltip-showing operations
+ $this.tooltip("hide");
+ $this.data("cancel", true);
+ };
+
+ // tooltips on <td>s make everything jump around, so use the <b>
+ $("b", $element).hover(mouseEnter, mouseLeave);
+ });
+ });
+})();
View
32 js/my.js
@@ -1,21 +1,23 @@
+// TODO wrap this in an anonymous function and consider attaching these method(s) to a global object
+
function timeAgo(from)
{
- var date = new Date;
- from = date.setTime(Date.parse(from))
+ var date = new Date();
+ from = date.setTime(Date.parse(from));
- var distance_in_seconds = ((new Date - from) / 1000);
- var distance_in_minutes = Math.floor(distance_in_seconds / 60);
+ var distance_in_seconds = ((new Date() - from) / 1000);
+ var distance_in_minutes = Math.floor(distance_in_seconds / 60);
- if (distance_in_minutes === 0) return "less than a minute ago";
- if (distance_in_minutes === 1) return "a minute ago";
- if (distance_in_minutes < 45) return distance_in_minutes + " minutes ago";
- if (distance_in_minutes < 90) return "about 1 hour ago";
- if (distance_in_minutes < 1440) return "about " + Math.round(distance_in_minutes / 60) + " hours ago";
- if (distance_in_minutes < 2880) return "1 day ago";
- if (distance_in_minutes < 43200) return Math.floor(distance_in_minutes / 1440) + " days ago";
- if (distance_in_minutes < 86400) return "about 1 month ago";
- if (distance_in_minutes < 525960) return Math.floor(distance_in_minutes / 43200) + " months ago";
- if (distance_in_minutes < 1051199) return "about 1 year ago";
+ if (distance_in_minutes === 0) return "less than a minute ago";
+ if (distance_in_minutes === 1) return "a minute ago";
+ if (distance_in_minutes < 45) return distance_in_minutes + " minutes ago";
+ if (distance_in_minutes < 90) return "about 1 hour ago";
+ if (distance_in_minutes < 1440) return "about " + Math.round(distance_in_minutes / 60) + " hours ago";
+ if (distance_in_minutes < 2880) return "1 day ago";
+ if (distance_in_minutes < 43200) return Math.floor(distance_in_minutes / 1440) + " days ago";
+ if (distance_in_minutes < 86400) return "about 1 month ago";
+ if (distance_in_minutes < 525960) return Math.floor(distance_in_minutes / 43200) + " months ago";
+ if (distance_in_minutes < 1051199) return "about 1 year ago";
- return "over " + Math.floor(distance_in_minutes / 525960) + " years ago";
+ return "over " + Math.floor(distance_in_minutes / 525960) + " years ago";
}
View
4 misc/cookies.html
@@ -7,9 +7,7 @@
title: cookies
---
-<script type="text/javascript">
- {% include cookies.js %}
-</script>
+<script type="text/javascript" src="/js/cookie-generator.js"></script>
<h3 class="underline">{{ page.title }}</h3>
View
18 package.json
@@ -0,0 +1,18 @@
+{
+ "name": "crdx.org",
+ "version": "1.0.0",
+ "description": "source of crdx.org",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/crdx/crdx.org.git"
+ },
+ "author": "crdx",
+ "license": "MIT",
+ "readmeFilename": "README.md",
+ "dependencies": {
+ "grunt": "~0.4.1",
+ "grunt-contrib-less": "~0.5.0",
+ "grunt-contrib-watch": "~0.3.1",
+ "grunt-contrib-jshint": "~0.3.0"
+ }
+}

No commit comments for this range

Something went wrong with that request. Please try again.