Skip to content

Instantly share code, notes, and snippets.

View sjungling's full-sized avatar

Scott Jungling sjungling

  • Moderne.io
  • Chico, CA
  • 17:52 (UTC -07:00)
View GitHub Profile
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
// all work and no play makes Scott a null boy
var SearchForm = Backbone.View.extend({
template: Handlebars.compile($('#search-template').html()),
options: {
buttonType: 'default',
method: 'GET',
value: null
},
initialize: function(options) {
_.extend(this.options,options);
this.render();
// 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