Skip to content

Instantly share code, notes, and snippets.

@symmetriq
symmetriq / lunchnlearn.css
Last active August 29, 2015 14:16
Lunch & Learn: Sass
/* Standard CSS comments are included in the output */
input[type="text"], input[type="password"], input[type="email"] {
padding: 3px 5px;
line-height: 20px;
}
/* Nesting is useful for grouping related rules, and reducing redundancy */
.fancy-list {
border: 1px solid black;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.
@symmetriq
symmetriq / less_to_scss.md
Created December 4, 2014 20:07
Convert LESS → SCSS

Convert LESS includes to SCSS.
Regex is PCRE. Adjust for your flavor as needed.
Now also handles includes in one-liners (e.g. a { .fancy-outline }).

Search
(\{ *|^ +)\.([\w_-]+(?:[(;]| *\}))

Replace
\1@include \2

@symmetriq
symmetriq / multiple_adjacent.scss
Last active August 29, 2015 14:10
SASS/LESS — adjacent rules for multiple selectors
a,
button {
+ a,
+ button {
margin-left: 5px;
}
}
@symmetriq
symmetriq / tree_indentation.scss
Created October 28, 2014 16:53
SCSS: Tree view indentation
@for $i from 1 through 10 {
.tree_depth_#{$i} { padding-left: 18px * $i }
}
@symmetriq
symmetriq / js_osa_test.js
Last active August 29, 2015 14:08
JavaScript Automation in OS X Yosemite
var Mail = Application('Mail')
, matches
, pad;
pad = function (input, length, fill) {
if (!fill || fill.length > 1) {
fill = (typeof input === 'string') ? ' ' : '0';
}
input = String(input);
return (
@symmetriq
symmetriq / apache_yosemite.md
Last active November 8, 2015 01:09
Get Apache working in OS X 10.10 "Yosemite"

In OS X 10.10 (Yosemite), Apache has been upgraded from 2.2 to 2.4, which includes some significant changes, and the default config file has changed quite a bit. When you install Yosemite, it renames your old config to httpd.conf~previous, and unfortunately your old one won't work anymore.

To get Apache working again, edit the following files:

/etc/apache2/httpd.conf

Uncomment:

@symmetriq
symmetriq / transition.scss
Created October 13, 2014 21:07
SASS: `transition` mixin with vendor-prefixed properties
// Transition
// Vendor-prefixed `transition` with individual properties also vendor-prefixed
// Takes a comma-separated list of properties to be transitioned.
// Each property looks like this: [property] [time] [timing-function]
// Property name must come first. The `time` and `timing-function` values are optional.
@mixin transition($properties...) {
$prefixes: webkit moz standard;
@symmetriq
symmetriq / pathVar.js
Last active November 13, 2017 02:17
[JS] pathVar: Utility for reading/writing nested object properties
/*
Utility for reading/writing nested object properties
- Read: pathVar(obj, 'some.path')
- Write: pathVar(obj, 'some.path', newVal)
To automatically create the path when writing (similar to `mkdir -p`):
pathVar(obj, 'some.new.path', newVal, true)
Automatic path creation will fail if any part of the path already exists and
is not an object.
@symmetriq
symmetriq / rebuild_launch_services.sh
Last active October 12, 2015 19:07
[OS X] Rebuild Launch Services DB
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user