Skip to content

Instantly share code, notes, and snippets.

View sjungling's full-sized avatar

Scott Jungling sjungling

  • Moderne.io
  • Chico, CA
  • 19:49 (UTC -07:00)
View GitHub Profile
@sjungling
sjungling / recent-repos.sh
Created February 16, 2023 00:04
CSV of all organizational repositories and default branch that I have access to that are not archived and have been updated in the last 2 years
#!/usr/bin/env bash
gh api graphql --paginate=true \
-f query='query (
$numOrgs: Int = 100
$numRepos: Int = 100
$endCursor: String
) {
viewer {
organizations(first: $numOrgs) {
@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 / launch.json
Last active January 25, 2021 17:12
VSCode Server-side Launch
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"name": "Attach By Process",
"processId": "${command:PickProcess}",
"request": "attach",
"skipFiles": [
"<node_internals>/**",
@sjungling
sjungling / pre-commit.sh
Last active September 3, 2017 15:45
New Build Preflight Check
#!/bin/sh
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
function check_master() {
printf "Checking to see if this is the master branch… "
# CONSTANT(S)
BRANCH_PATTERN="^# On branch ([^${IFS}]*)"
# Get status w/current branch
@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: [

Keybase proof

I hereby claim:

  • I am sjungling on github.
  • I am sjungling (https://keybase.io/sjungling) on keybase.
  • I have a public key whose fingerprint is 4869 FACA 1145 A6F1 289C 5640 7855 04CC E3CC 889C

To claim this, I am signing this object:

@sjungling
sjungling / prepare-commit-msg
Created April 6, 2016 04:45
Auto-append branch names to a commit message
#!/bin/sh
#
# Prepend the branch name to the commit message
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg
#
# A couple notes:
# 1. The file must be executable (chmod +x prepare-commit-msg)
# 2. This works on a per-repo basis
@sjungling
sjungling / view.js
Created January 7, 2014 21:21
Sample of how to organize Backbone
/**
* Backbone View Organization
*
* 1. View options (events, tagName, el, etc.)
* 2. Initializer
* a. Should call private functions to do setup for listeners, etc.
* 3. Public Methods
* 4. Private Methods
* a. Shall begin with an underscore (_) prefix.
*
@sjungling
sjungling / browse.js
Created November 21, 2013 21:28
helper for normalizing facet unqiue ids
var getFacetUniqueId = function getFacetUniqueId(facet) {
var facetComponents;
if (typeof facet === 'string') {
facetComponents = facet.split('=');
}
if (_.isObject(facet)) {
if (_.has(facet, 'name') && _.has(facet, 'value')) {
facetComponents = [facet.name, facet.value];
casper = require('casper').create()
casper.test.begin "Check for dataLayer on product page", 1, (test) ->
casper.start 'http://local.build.com/k-690/p173354', ->
test.assertEval ->
typeof window.dataLayer.productId != "undefined"
, 'Does dataLayer.productId exist?'
test.assertEvalEquals ->
window.dataLayer.productId
, "K-690", 'Is the value of dataLayer.productId "K-690"?'