Skip to content

Instantly share code, notes, and snippets.

@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;
@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 / 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 / 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 %}
<textarea style="height: 100%; width: 100%; background: #222; padding: 5% 25%; color: #eee;"></textarea>
@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({
});
@imjared
imjared / rename.sh
Last active December 24, 2015 00:29
if you get a bunch of files that have an undesirable prefix and you want to remove it, just tell this script the prefix
#!/bin/bash
# takes an argument of an undesired prefix then removes it from all files in dir
# if no arg is passed, prompt for name
if [ $# -eq 0 ]
then
read -p 'What prefix do you want to remove?: '
prefix=$REPLY
else
prefix=$1
@imjared
imjared / lime.sh
Created October 16, 2013 16:16
Add to /usr/local/bin. Use `lime [path]` instead of `subl [path]` to open sublime projects. If a project file exists it opens and preserves project settings. Requires `subl`. In response to http://www.sublimetext.com/forum/viewtopic.php?f=3&t=14129
#!/bin/bash
projectFile=$(find $1 -name "*.sublime-project" -maxdepth 1)
echo $projectFile
if [ $projectFile ]
then
subl $projectFile
else
subl $1
fi
@imjared
imjared / logo.scss
Last active August 29, 2015 14:00
source for codepen.io/imjared/full/athzf.
@import "mathsass/dist/math.scss";
$radius: 12px;
$colors : (
1: #746f86,
2: #746f86,
3: #a16e8f,
4: #a16e8f,
5: #a9637b,
6: #a9637b,
@imjared
imjared / bootstrap-breakpoints.scss
Last active August 16, 2016 10:13
scss breakpoint helpers based on bootstrap
// breakpoint helpers based on bootstrap's breakpoints
@mixin xs {
@media #{screen} and (max-width: #{$screen-xs-max}) {
@content;
}
}
@mixin sm {
@media #{screen} and (min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max}) {