Skip to content

Instantly share code, notes, and snippets.

View sjungling's full-sized avatar

Scott Jungling sjungling

  • Moderne.io
  • Chico, CA
  • 21:49 (UTC -07:00)
View GitHub Profile
@sjungling
sjungling / wishlist.coffee
Created March 20, 2013 20:41
wishlist for display_simple
jQuery ($) ->
###*
DropdownMenu provides a simple button / reveal content model
Generic enough to be reused provided there's a .button and .expandable child element
@class DropdownMenu
@requires jQuery 1.8+
###
class DropdownMenu
###*
# jQuery Widget Experiment
$.widget 'build.ddmenu',
ATTRS:
NAME: 'ddmenu'
STATE: 'COLLAPSED'
CLASSES:
EXPANDED: 'is-expanded'
COLLAPSED: 'is-collapsed'
_create: ->
B.log 'Created', 'info', @ATTRS.NAME
@sjungling
sjungling / combo.cfm
Last active December 15, 2015 02:39
Combo loader utility for IDS. Rather than have multiple includes, try to bundle up to minimize the number of HTTP requests
<!--- combo.cfm -->
<cfscript>
comboContents = "";
response = getPageContext().getResponse();
for(asset in url) {
assetFileName = "";
// Kinda hack-ish as the last in, wins, might be best just to default all to JS or group by type in requestutility.cfc
if (find("scripts/", asset)) {
response.setContentType('text/javascript');
} else if (find("css/", asset)) {
@sjungling
sjungling / github.groovy
Last active December 27, 2016 03:41
GitHub Notifications for your office
/**
* GitHubber
*
* Author: [email protected]
* Date: 2013-03-14
*/
def preferences() {
[
sections: [
@sjungling
sjungling / gist:5157598
Last active December 14, 2015 22:19
DDS
/**
* Desk Defense System
* Don't steal my laptop, bro!
*
* Author: Team Kickass
*/
def preferences() {
return [
sections: [
@sjungling
sjungling / pre-commit
Created February 12, 2013 20:32
Prevent Pushing to Master
#!/bin/sh
# CONSTANT(S)
BRANCH_PATTERN="^# On branch ([^${IFS}]*)"
# Get status w/current branch
git_status=$(git status 2> /dev/null)
# Get current branch name
if [[ ${git_status} =~ ${BRANCH_PATTERN} ]]; then
branch_name=${BASH_REMATCH[1]}
@sjungling
sjungling / bashrc
Last active December 12, 2015 00:58
Bash Shell Upgrade
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[1;37m\]"
COLOR_NONE="\[\e[0m\]"
# Replace YOUR_ORG with your global namespace
window.YOUR_ORG =
debug: false
log: (msg, type, context) ->
message = undefined
if window.console and @debug
if typeof msg is "string" and context isnt undefined
message = "(" + (new Date().getTime()) + ") " + context + ": " + msg
else
message = msg
Rewrite sjungling.csuchico.edu/?endDate=2013-01-09 sjungling.build.com/?startDate=2013-01-10 [R=301,L]
@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