Skip to content

Instantly share code, notes, and snippets.

View q0rban's full-sized avatar
👋

James Sansbury q0rban

👋
View GitHub Profile
select g.destid1, i.destid1 from kaltura_gallery_entries k1 right join migrate_map_gallery g on k1.gid = g.sourceid1 right join migrate_map_galleryitem i on k1.kid = i.sourceid1 where k1.kaltura_order=(select min(k2.kaltura_order) from kaltura_gallery_entries k2 where k1.gid = k2.gid);
@q0rban
q0rban / flow-fluid-userscript.js
Created June 13, 2012 12:49
Flow Fluid UserScript
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var badge = 0,
overdue = $('b.badge.overdue').text(),
inbox = $('b.badge.inbox-badge:visible').text();
if (overdue) {
@q0rban
q0rban / tz-drupal-7-revert.sql
Created July 30, 2012 20:25
Tz Drupal 7 database reverts
DROP TABLE role_permission, date_format_type, `comment`, taxonomy_term_data,
node_revision, filter, filter_format, block, block_role, blocked_ips,
taxonomy_term_hierarchy, field_config, block_custom,
field_config_instance, cache_field, field_data_body,
field_data_comment_body, field_revision_body,
field_revision_comment_body, field_data_field_image,
field_data_field_tags, field_revision_field_image,
field_revision_field_tags, block_node_type, file_managed,
taxonomy_index, file_usage, taxonomy_vocabulary;
@q0rban
q0rban / gist:3952409
Created October 25, 2012 12:58
Line Height Test
<!DOCTYPE html>
<html>
<head>
<title>Line Height Test</title>
<style type="text/css">
.with-ems {
font-size: 100%; /* 16px */
line-height: 1.5em;
}
.without-ems {
@q0rban
q0rban / gitosnap.sh
Created November 16, 2012 16:03
Monosnap/Github Shell Script
#!/usr/bin/env sh
# https://gist.github.com/4088499
FIND="^monosnap.com\/image\/\([a-zA-Z0-9]*\)"
REPLACE="![](https:\/\/api.monosnap.com\/image\/download\?id=\1)"
pbpaste |
# Different versions of monosnap have this formatted differently, so we grep
# first for just what we need.
grep -o monosnap.com/image/[a-zA-Z0-9]* |
# Grab the current cliboard contents and do our replacement.
@q0rban
q0rban / jgd_pull_request_builder.sh
Created December 7, 2012 20:53
Example Job for Jenkins Github Drupal Pull Request Builder
#!/usr/bin/env bash
set -e
# Jenkins job script for use with the Jenkins Github Drupal, which can be found
# at https://github.com/Lullabot/jenkins_github_drupal. NOTE, all shell scripts
# have been symlinked to /usr/local/bin to make them easier to call here. For
# example:
# ln -s /usr/local/share/jenkins_github_drupal/prepare_dir.sh \
# /usr/local/bin/jgd-prepare-dir
@q0rban
q0rban / jenkins_log_parser_drush
Created December 7, 2012 21:04
Jenkins Drush Log Parser rules
warning /\[warning\]/
error /\[error\]/
info /\[completed\]/
info /\[success\]/
info /\[ok\]/
error /Processed 0/
<?
// So at the top of the node--article.tpl.php there's this
$view = 'related_bits';
$display = 'block';
$related_bits_block = views_embed_view($view, $display);
// Then down within the actual page markup stuff there's this
<?php if (isset($related_bits_block) && $related_bits_block): ?>
@q0rban
q0rban / drupal_simpletest_xdebug.php
Last active January 23, 2016 21:40
Get Xdebug working with Simpletest in Drupal
<?php
/**
* @file
* Extends DrupalWebTestCase to use Xdebug for drupalGet() and drupalPost().
*/
class DrupalXdebugWebTestCase extends DrupalWebTestCase {
/**
* Override the parent drupalPost to allow xdebug options.
@q0rban
q0rban / gist:5946539
Created July 8, 2013 06:08
My first python script!
#!/usr/bin/env python
from peewee import *
DATABASE = 'lullabot'
USER = 'sandbox'
PASSWD = 'sandbox'
mysql_db = MySQLDatabase(DATABASE, user=USER, passwd=PASSWD)
class MySQLModel(Model):