Skip to content

Instantly share code, notes, and snippets.

View norcal82's full-sized avatar

Clint Bettiga norcal82

  • Northern California
View GitHub Profile
@norcal82
norcal82 / day_of_week.arcade
Last active April 23, 2021 19:33
Day of Week Arcade Expression
var day = $feature.Reported_DOW;
When(day == "MONDAY", 1,
day == "TUESDAY", 2,
day == "WEDNESDAY", 3,
day == "THURSDAY", 4,
day == "FRIDAY", 5,
day == "SATURADAY", 6,
day == "SUNDAY", 7,
0);
@norcal82
norcal82 / hash_methods.rb
Created March 3, 2016 19:41
Ruby Hash Methods
def group_by_key_with_counts collection
collection.inject {|a, b| a.merge(b) { |_, old_val, new_val| old_val + new_val} }
end
@norcal82
norcal82 / mixins.css
Last active September 9, 2015 02:24
mixins
@mixin flex($direction: center) {
@include display(flex);
@include align-items($direction);
@include justify-content($direction);
}
.flex-center { @include flex(center);}
.flex-start { @include flex(start);}
.flex-end { @include flex(end);}
@norcal82
norcal82 / binding.js
Created June 18, 2015 16:10
mini data binding
$('body')
.on 'focus', '[contenteditable]', ->
$this = $(this)
$this.data 'before', $this.html()
.on 'blur keyup paste input', '[contenteditable]', ->
$this = $(this)
if $this.data('before') isnt $this.html()
$this.data 'before', $this.html()
$this.trigger('change')
new_text = $this[0].innerText
@norcal82
norcal82 / gulpfile.coffee
Created May 7, 2015 16:13
gulpfile.coffee
###******************************************************************************
1. DEPENDENCIES
******************************************************************************
###
'use strict'
gulp = require('gulp')
jade = require('gulp-jade')
minifyHTML = require('gulp-minify-html')
sass = require('gulp-sass')
@norcal82
norcal82 / state_names
Created August 19, 2014 21:47
clojure list of US state names
(list "Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming")
@norcal82
norcal82 / state_names.py
Created August 19, 2014 21:45
python array of US state names
state_names = ["Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming"]
@norcal82
norcal82 / state_names.php
Created August 19, 2014 21:43
php array of US state names
$state_names = array("Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming");
@norcal82
norcal82 / state_names
Created August 19, 2014 21:41
scala array of us state names
var state_names = Array("Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming");
@norcal82
norcal82 / state_names.js
Created August 19, 2014 21:35
javascript array of us state names
var state_names = ["Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming"];