Skip to content

Instantly share code, notes, and snippets.

View sirkitree's full-sized avatar

Jerad Bitner sirkitree

View GitHub Profile
@sirkitree
sirkitree / block.php
Created September 21, 2011 02:42
Loading a block programatically
<?php
$module = "boxes"; // this is the name of whatever module actually creates the block, I so happen to love boxes.
$delta = "video_homepage_footer"; // this is the machine name of the block (or in this case box)
$block = (object) module_invoke($module, 'block', 'view', $delta);
$block->module = $module;
$block->delta = $delta;
print theme('block', $block);
@sirkitree
sirkitree / yammer.css
Created January 28, 2012 17:49
Userstyle for Yammer within Fluid
body,
div.page-content.two-column-layout,
div.page-content.three-column-layout {
background: none !important;
}
.two-column-layout #column-two {
margin-top: 0px !important;
padding-top: 0px !important;
}
@sirkitree
sirkitree / gist:1747860
Created February 5, 2012 20:46
New blog command for Octopress
###########
## Blogging
function new_post {
cd /Users/sirkitree/github/octopress
rake new_post["$1"]
}
alias blog="new_post"
@sirkitree
sirkitree / gist:1747985
Created February 5, 2012 21:18
Trying to write a test with SineJS
var fs = require('fs');
var path = require('path');
...
var file = path.join(__dirname, '..', 'tmp', 'todo.txt');
...
describe('.export()', function(done) {
@sirkitree
sirkitree / gist:1780766
Created February 9, 2012 15:51
only show cached data if no response
/**
* Implementation of hook_block().
*/
function twitfaves_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
...
case 'view':
$screen_name = variable_get('twitfaves_screen_name', 'lullabot');
$count = variable_get('twitfaves_count', 3);
if ($tweets = twitfaves_generate($screen_name, $count)) {
article.article-teaser .article-content {
min-height: 350px;
}
article.article-teaser .article-content p img {
width: 75px;
float: right;
}
article.article-teaser .article-content .field-item>p:nth-of-type(2) img {
width: 200px;
@sirkitree
sirkitree / 01.js
Created April 10, 2012 14:16
Project Euler challenge #1
// Project Euler challenge #1
// https://projecteuler.net/problem=1
var total = 0,
i = 1000;
while (i--) {
if (i % 3 === 0 || i % 5 === 0) {
total += i;
}
}
@sirkitree
sirkitree / 02.js
Created April 15, 2012 19:53
Project Euler challenge #2
// Project Euler challenge #2
// https://projecteuler.net/problem=2
var a = 1, b = 2, sum = 0;
while (a < 4000000) {
if (a % 2 == 0) sum += a;
var tmp = a;
a = b;
b += tmp;
}
@sirkitree
sirkitree / 03.lua
Created April 22, 2012 04:21
Project Euler #3
--[[
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
--]]
function get_all_factors(number)
local factors = {}
for possible_factor=1, math.sqrt(number), 1 do
local remainder = number%possible_factor
@sirkitree
sirkitree / reset.sh
Created August 3, 2012 13:53
reset.sh
drush site-install lagra -y
drush upwd admin --password="admin"
drush fra --force -y
drush dis overlay -y
drush cc all
# Migrate taxonomy terms
drush lmi tag
drush lmi genre
drush lmi award