Skip to content

Instantly share code, notes, and snippets.

View swider's full-sized avatar

Nick Swider swider

View GitHub Profile
@swider
swider / fix-theme-slugs-mongo.js
Created December 6, 2011 19:15
Script to update theme slugs
/********************************************************************
* fix-theme-slugs-mongo.js
*
* To run, replace localhost/db_name with your connection info and
* run this command:
*
* mongo localhost/db_name --quiet fix-layout-slugs-mongo.js
*
*/
@swider
swider / rotate.less
Created October 6, 2011 22:46
LESS Rotate Mixin for IE
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;
@swider
swider / gs.sh
Created February 4, 2011 21:55
Command line utility to search git repo
#!/bin/bash
QUERY=`echo $1 | sed 's/ /+/'g`
DIR=$PWD
function parse_github_repo {
echo `cd $DIR;git config -l | grep 'remote.origin.url' | sed -En 's/remote.origin.url=git(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/\3\/\4/p'`
}
URL="https://github.com/$(parse_github_repo)/search?q=$QUERY"