Skip to content

Instantly share code, notes, and snippets.

View clamstew's full-sized avatar
🧘
🎨 🤖 🚀 vibe-coding 24/7. Let's Go!

Clay Stewart clamstew

🧘
🎨 🤖 🚀 vibe-coding 24/7. Let's Go!
View GitHub Profile
def initialize (args={:event_time, :deadline, :event_name, :event_location, :minimum_attendees, :maximum_attendees, :creator_name, :phone, :email, :invitees})
@required = args.fetch(:event_time, :deadline, :minimum_attendees) # .fetch will throw an error if key doesn't exist in Hash
@optional = args[:creator, :event_name, :event_location, :attendees, :maximum_attendees] # simple access returns nil if key isn't set--no exception raised
end
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
var cls = [];
Array.prototype.slice.call( document.querySelectorAll('*'), 0 ).forEach( function ( el ) {
cls = cls.concat( Array.prototype.slice.call( el.classList, 0 ) );
} );
cls = cls.reduce( function ( p, c ) {
if ( p.indexOf( c ) < 0 ) p.push( c );
return p;
}, [] );
console.log( cls );
@clamstew
clamstew / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@clamstew
clamstew / Default.sublime-theme
Last active August 28, 2015 21:01
Hide Sublime Text 3's folder and file icons in the sidebar
[
{
"class": "icon_file_type",
"content_margin": [0,0]
},
{
"class": "icon_folder",
"content_margin": [0,0]
},
{

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

@clamstew
clamstew / forcelowercase.js
Last active October 5, 2016 02:31 — forked from dkarter/forcelowercase.js
Angular directive to force lowercase letters on an input textbox as you type
'use strict';
/**
* @ngdoc directive
* @name myapp.directive:forceLowerCase
* @description
* # forceLowerCase
*/
angular.module('myApp').directive('forceLowerCase', [
'$parse',
[alias]
cleanfeature = branch --merged | grep "feature/" | xargs -n 1 git branch -d
[merge]
tool = p4mergetool
renameLimit = 8000
[mergetool "p4mergetool"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED
trustExitCode = false
[mergetool]
keepBackup = false
var nextLink;
function open_page(url) {
console.log("Opening " + url);
osmosis.get(url)
.find('#nav td:last a')
.set({
'nextLink': '@href'
})
.find('.g')
.set({