Skip to content

Instantly share code, notes, and snippets.

View popthestack's full-sized avatar
🍩
Eating Donuts

Ryan Martinsen popthestack

🍩
Eating Donuts
View GitHub Profile
git clone git://repo.or.cz/fast-export.git
mkdir fast-export/log
mkdir your_new_git_repo
cd !$
git init
../fast-export/hg-fast-export.sh --force -r "../path_to/hg_repo" &> "../fast-export/log/export_log"
git gc --aggressive &>/dev/null &
# wait. it may take a while for the git gc command to finish even though it looks like it finished quickly.
<?php
function mytheme_get_user_profile($uid = NULL) {
if (empty($uid)) {
global $user;
$uid = $user->uid;
}
$result = db_query("
SELECT f.fid AS f__fid, f.name AS f__name, f.title AS f__title, v.value AS v__value
<?php
$please['don\'t']='tell me';
$that['your']=$code->isMore->readable_than_mine;
$simply['because']=you::put()->brackets;
$onNew->lines=$when->everythingElse($you,'write',$looks->likeThis); // (no spaces, everything smashed together)
$i_want['to']->punch($you)->inTheFace();
@popthestack
popthestack / solaris-mod.js
Created February 15, 2011 21:19
tumblr solaris theme without hiding youtube videos
// Solaris functions v1.1 by Matthew Buchanan http://matthewbuchanan.name except where noted
// Bind events to zoom controls to switch between link and high-res URLs
// and to open lightbox if there is no enclosing anchor around the image.
$("span.zoomcontrol").live("mouseenter", function() {
$(this).fadeTo("fast",0.75);
}).live("mouseleave", function() {
$(this).fadeTo("fast",0.375);
}).live("click", function(e) {
e.preventDefault();
@popthestack
popthestack / gist:1230586
Created September 20, 2011 22:16
Fixing google search (Firefox search plugin) to include all my blasted terms.
- <os:Param name="q" value="{searchTerms}"/>
+ <os:Param name="q" value="allintext:{searchTerms}"/>

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For less, I'm using the ruby version because this is what they suggest on the website. The javascript version may be different.

Variables

@popthestack
popthestack / google-ssl-verbatim.xml
Created December 28, 2011 22:34
Google SSL Verbatim firefox search plugin
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Google SSL Verbatim</os:ShortName>
<os:Description>Google SSL Verbatim Search</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi3
@popthestack
popthestack / gps1.bash
Created February 1, 2012 00:09 — forked from bobthecow/gps1.bash
A better PS1 for Git
#!/bin/bash
#
# A better PS1 for Git
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.gps1.bash`) and source it in `.bashrc`
@popthestack
popthestack / wp-to-nanoc.php
Created April 29, 2012 18:48
Hacked together Wordpress -> Nanoc script
<?php
$db = mysql_connect('localhost', 'db_user', 'db_password');
mysql_select_db('blog');
$sql = "SELECT * FROM wp_posts WHERE post_status IN ('publish', 'private') AND post_type = 'post'";
$r = mysql_query($sql);
get_posts($r);
// do drafts separately in order to keep them from messing with published posts' URLs
lol ~= haha
LOL ~= HAHA ~= hahaha
rofl ~= HAHAHAH ~= hahahahahahaha
ROFL ~= HAHAHAHAHAHHAHAHAHA ~= hahahahahahahahahahahaha
LMFAO ~= HAHAHAe+26 snort