Skip to content

Instantly share code, notes, and snippets.

View sjungling's full-sized avatar

Scott Jungling sjungling

  • Moderne.io
  • Chico, CA
  • 21:07 (UTC -07:00)
View GitHub Profile
@sjungling
sjungling / index.js
Created March 20, 2013 21:15
un-class-ified index for wishlists:index
// Generated by CoffeeScript 1.6.1
jQuery(function($) {
var changeList, copyItem, createList, deleteItem, deleteList, node, updateProductInfo, updateUserInfo;
updateUserInfo = function() {
console.log("updateUserInfo called");
return $.ajax({
url: '/index.cfm?page=wishlists:user_info&fmt=pjax',
success: function(res) {
return $('#user-info').replaceWith(res);
@sjungling
sjungling / wishlist.js
Last active December 15, 2015 05:19
un-class-ified wishlist for display_simple
// Generated by CoffeeScript 1.6.1
jQuery(function($) {
var addProductToWishList, addToWishList, button, collapse, container, createForm, createWishList, expand, icon, listsContainer, node, resizeWidget, toggleDropdown, updateWishlistLists;
collapse = function() {
console.log("Collapse it");
if ((typeof node !== "undefined" && node !== null) && (typeof container !== "undefined" && container !== null)) {
node.removeClass('is-expanded').addClass('is-collapsed');
return container.animate({
'height': 0
@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: scott.jungling@build.com
* 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