Skip to content

Instantly share code, notes, and snippets.

@imjared
imjared / scraping-with-casperjs.js
Created March 20, 2013 00:33
A CasperJS script that crawled a list of links on then scraped the relevant content on each page and output it to a nicely formatted XML file. Sure beats database dumps/SQL manipulation, in my opinion.
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* grab links and push them into xml
*/
var casper = require("casper").create({
});
<textarea style="height: 100%; width: 100%; background: #222; padding: 5% 25%; color: #eee;"></textarea>
@imjared
imjared / gist:4136553
Created November 23, 2012 17:23
Build tables in Jekyll
<!-- store in _includes/table -->
<table>
<tr class="header">
{% for headerItem in site.table[tableName].headers %}
<th>{{ headerItem }}</th>
{% endfor %}
</tr>
{% for dataRow in site.table[tableName].data %}
@imjared
imjared / Add new line
Last active October 11, 2015 06:58
Find css closing brackets that don't have newlines after them. Useful if you get css that isn't formatted so nicely.
\}\n(#|\.|[A-Z]|/|:|\*)
@imjared
imjared / {sv_performance}
Created September 28, 2012 16:49
query performance
{if member_group == '1'}
<div id="site-performance" style="position: fixed; right: 0; bottom: 0; padding: 7px; background: rgba(0,0,0,0.7); color: white; font-family: Verdana, sans-serif; z-index: 999; ">
<span id="site-total-queries">{total_queries}</span> queries<br />
<span id="site-elapsed-time">{elapsed_time}</span> seconds
</div>
{/if}
@imjared
imjared / dabblet.css
Created June 26, 2012 19:44
radiating circle object in one line of html and a few more lines of css
/**
* radiating circle object in one line of html and a few more lines of css
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
display: -webkit-box;
-webkit-box-align: center;