Skip to content

Instantly share code, notes, and snippets.

View sjungling's full-sized avatar

Scott Jungling sjungling

  • Moderne.io
  • Chico, CA
  • 14:12 (UTC -07:00)
View GitHub Profile
// determine sponsor name & URL
$result = DBQuery($database, "SELECT * FROM vtcal_sponsor WHERE calendarid='".sqlescape($_SESSION["CALENDARID"])."' AND id='".sqlescape($event['sponsorid'])."'" );
$sponsor = $result->fetchRow(DB_FETCHMODE_ASSOC,0);
$id = getNewEventId();
$id1 = substr($id,0,10);
for ($i=1; $i<=$eventnr; $i++) {
$event = $eventlist[$i];
if (empty($event['displayedsponsor'])) { $event['displayedsponsor']=$sponsor['name']; }
if (empty($event['displayedsponsorurl'])) { $event['displayedsponsorurl']=$sponsor['url']; }
YUI().use("node-base", function($){
$.on("domready", function(){
$.log("foo");
});
});
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="[\u@\h:\w]$YELLOW\$(parse_git_branch)$GREEN\$ "
// Custom Mixins
@mixin size ($size: 13px) {
font-size: $size / 13 * 100%
}
@sjungling
sjungling / gist:861177
Created March 8, 2011 22:00
yum install maven2
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
maven2 noarch 2.2.1-14.fc14 updates 1.4 M
Installing for dependencies:
apache-commons-beanutils noarch 1.8.3-2.fc14 fedora 226 k
@sjungling
sjungling / mobile_redirect.js
Created March 25, 2011 17:53
Wherein we redirect people to a mobile site in the absence of a full site flag
if (!window.location.search.match(/fs=1/) && (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i))) {
window.location = "http://mobile.csuchico.edu/";
}
@sjungling
sjungling / application_helper.rb
Created March 2, 2012 00:06
Zurb Foundation Pagination styles with WillPaginate 3.x on Rails 3.2.x
#
# Concept from https://gist.github.com/1205828
#
module ApplicationHelper
class FoundationLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag(:ul, html, container_attributes)
end
@sjungling
sjungling / application_helper.rb
Created April 20, 2012 16:06
Zurb Foundation Icon Fu
module ApplicationHelper
def glyph(letter, glyph_set = "", extra_classes = "")
glyph_set = "general" if glyph_set.blank?
html_options = {
:class => ["glyph", glyph_set, extra_classes].join(" ")
}
content_tag(:span, letter, html_options)
end
end
@sjungling
sjungling / curl-header.sh
Created June 28, 2012 00:05
curling yui loader
[sjungling@sjc] ~ $ curl -I http://yui.yahooapis.com/combo?3.5.1/build/yui/yui-min.js
HTTP/1.1 200 OK
Vary: Accept-Encoding
Cache-Control: max-age=315360000
Last-Modified: Wed, 27 Jun 2012 22:58:57 GMT
Content-Type: application/javascript; charset=utf-8
Expires: Sat, 05 Sep 2026 00:00:00 GMT
Content-Encoding: gzip
Date: Wed, 27 Jun 2012 22:58:57 GMT
Age: 4580
Rewrite sjungling.csuchico.edu/?endDate=2013-01-09 sjungling.build.com/?startDate=2013-01-10 [R=301,L]