Skip to content

Instantly share code, notes, and snippets.

View evenicoulddoit's full-sized avatar

Ian Clark evenicoulddoit

View GitHub Profile
{
"theme": "Spacegray.sublime-theme",
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_white_space": "all",
"tab_size": 2,
"translate_tabs_to_spaces": true,
"use_tab_stops": true,
"rulers": [80, 120],
"show_minimap": false,
"caret_style": "smooth",
@evenicoulddoit
evenicoulddoit / js-delegate.js
Last active June 19, 2022 09:02
Basic JavaScript Delegation
(function(document, EventTarget) {
var elementProto = window.Element.prototype,
matchesFn = elementProto.matches;
/* Check various vendor-prefixed versions of Element.matches */
if(!matchesFn) {
['webkit', 'ms', 'moz'].some(function(prefix) {
var prefixedFn = prefix + 'MatchesSelector';
if(elementProto.hasOwnProperty(prefixedFn)) {
matchesFn = elementProto[prefixedFn];
@evenicoulddoit
evenicoulddoit / merged.js
Created February 1, 2015 20:42
JS Nested Merge
function merged() {
var mergeInto;
[].forEach.call(arguments, function(obj, i) {
if(i === 0) {
mergeInto = obj;
}
else {
Object.keys(obj).forEach(function(key) {
var existing = mergeInto[key],
@evenicoulddoit
evenicoulddoit / .jscsrc
Last active August 29, 2015 14:19
JSCS RC
{
"requireCurlyBraces": true,
"requireSpaceAfterKeywords": [
"return", "else"
],
"disallowSpaceAfterKeywords": [
"if", "for", "while", "switch"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
@evenicoulddoit
evenicoulddoit / widgets.py
Last active August 29, 2015 14:19
IterableSelectDateWidget
import datetime
import re
from django.conf import settings
from django.forms.extras import SelectDateWidget
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe, six
from django.utils.dates import MONTHS
from django.utils.formats import get_format
from django.utils.safestring import mark_safe
@evenicoulddoit
evenicoulddoit / SassMeister-input.scss
Last active November 16, 2015 14:45
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$bem-element-separator: '__';
$bem-modifier-separator: '--';
@function selectorToString($selector) {
$selector: inspect($selector); //cast to string
$selector: str-slice($selector, 2, -2); //remove brackets
@evenicoulddoit
evenicoulddoit / SassMeister-input-HTML.html
Created November 16, 2015 14:21
Generated by SassMeister.com.
<div class="class">asd</div>
@evenicoulddoit
evenicoulddoit / SassMeister-input.scss
Created November 16, 2015 14:46
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$bem-element-separator: '__';
$bem-modifier-separator: '--';
@function selectorToString($selector) {
$selector: inspect($selector); //cast to string
$selector: str-slice($selector, 2, -2); //remove brackets
@evenicoulddoit
evenicoulddoit / SassMeister-input.scss
Created November 16, 2015 14:46
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$bem-element-separator: '__';
$bem-modifier-separator: '--';
@function selectorToString($selector) {
$selector: inspect($selector); //cast to string
$selector: str-slice($selector, 2, -2); //remove brackets
@evenicoulddoit
evenicoulddoit / SassMeister-input.scss
Created November 16, 2015 14:47
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$bem-element-separator: '__';
$bem-modifier-separator: '--';
@function selectorToString($selector) {
$selector: inspect($selector); //cast to string