Skip to content

Instantly share code, notes, and snippets.

View lvl99's full-sized avatar

Matt Scheurich lvl99

View GitHub Profile
@lvl99
lvl99 / components.filter-items.js
Last active February 15, 2017 14:44
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
filteredItems: Ember.computed('items', function () {
// Imagine more than just one filter here
return this.get('items').filterBy('showMe', true)
}),
sortDirection: ['lastUpdated:desc', 'createdAt:desc'],
sortedItems: Ember.computed.sort('filteredItems', 'sortDirection'),
@lvl99
lvl99 / components.create-item.js
Last active February 23, 2017 07:01
Filtering and sorting via computed properties
import Ember from 'ember'
export default Ember.Component.extend({
store: Ember.inject.service(),
title: undefined,
location: undefined,
rating: undefined,
inputRatings: [{
label: 'Not rated',
# Incorporate this function into your .bash_profile (.bashrc, .zshrc, or whatever you use...)
# Run `mov2frames name-of-mov.mov` to extract frames from the movie file
# Run `mov2frames name-of-mov.mov 300` to extract frames from the movie file at a maximum width of 300 pixels
# Frames will be exported into a `frames/` folder
# NOTE: if the frames folder exists and contains files that match the filename `frame_%03d.png`, no frames will be generated
mov2frames() {
if [ ! -z "$2" ]
then
size=$2
else
@lvl99
lvl99 / emoji.json
Last active August 27, 2016 11:27
A JSON array containing unicode/byte character info and description extracted from Tim Whitlock's "Emoji Unicode Tables" (http://apps.timwhitlock.info/emoji/tables/unicode), which is probably the best reference out there. From last count there are 842 characters listed.
[
{
"unicode": "U+1F601",
"bytes": "\\xF0\\x9F\\x98\\x81",
"description": "grinning face with smiling eyes",
"htmlchar": "😁"
},
{
"unicode": "U+1F602",
"bytes": "\\xF0\\x9F\\x98\\x82",
@lvl99
lvl99 / inline-svg-code.less
Created March 20, 2016 09:34
This mixin allows you to embed SVG code within CSS files using LESS. The techniques within this mixin relate to the insights found at CSS Tricks' article "Probably Don't Base64 SVG"
// Inline SVG code images in LESS CSS
// @author Matt Scheurich <matt@lvl99.com> (http://lvl99.com)
// Github: https://github.com/lvl99/less-inline-svg-code
.inline-svg-code( @code ) {
@-svg-code: escape(~'<?xml version="1.0" ?>@{code}');
@-inline-svg-code: ~'data:image/svg+xml,@{-svg-code}';
@-inline-svg-url: ~"url('@{-inline-svg-code}')";
}
// Basic Example
@lvl99
lvl99 / scss-dynamic-breakpoint-media-queries.scss
Last active March 2, 2016 10:20
This is just a few ramshackle mixins I put together based on a theory. Don't know if they're suitable for production yet, but check it out. Please note that it's all only supported by `min/max-width`, no pixel density or orientation conditions, or even anything other than the `screen` media type.
/*
* SCSS Dynamic Breakpoint Media Queries
* Author: Matt Scheurich <matt@lvl99.com>
*
* This is just a few ramshackle mixins I put together based on a theory.
* Don't know if they're suitable for production yet, but check it out.
* Please note that it's all only supported by `min/max-width`, no pixel
* density or orientation, or even anything other than the `screen` media type.
*/