Skip to content

Instantly share code, notes, and snippets.

View wanderingmatt's full-sized avatar
🔍
Searching for my next adventure

Matthew Anderson wanderingmatt

🔍
Searching for my next adventure
View GitHub Profile
@wanderingmatt
wanderingmatt / gulpfile.js
Last active April 17, 2021 18:57
Basic gulpfile that handles serving, watching, compiling, and deploying to GitHub Pages.
const gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
cache = require('gulp-cache'),
concat = require('gulp-concat'),
connect = require('gulp-connect'),
del = require('del'),
ghPages = require('gulp-gh-pages-with-updated-gift'),
imagemin = require('gulp-imagemin'),
imageminPngquant = require('imagemin-pngquant'),
@wanderingmatt
wanderingmatt / ContentView.swift
Created November 2, 2019 22:12
Fading text from state change
import SwiftUI
struct ContentView: View {
@EnvironmentObject var taos: TaoStore
@State var tao: Tao
@State var showTao = false
fileprivate func toggleShowTao() {
withAnimation(.easeInOut(duration: 0.35)) {
let colors: [String] = [
"Blue",
"Green",
"Orange",
"Purple",
"Red",
"Yellow"
]
func randomBackgroundColor() -> Color? {
@wanderingmatt
wanderingmatt / _retina-sprite.scss
Created October 1, 2012 17:19
Mixin that generates both a regular and retina sprite (using the Compass Sprite Helpers) and returns the appropriate declarations and media queries.
// Mixin that generates both a regular and retina sprite (using the Compass Sprite Helpers) and returns the appropriate declarations and media queries.
//
// $folder - The name of the folder that contains the icons to sprite.
//
// No styleguide reference.
@mixin retina-sprite($folder) {
$sprites: sprite-map("icons/#{$folder}/*.png"); // Generates a sprite containing every icon in the supplied folder.
$sprites-2x: sprite-map("icons/#{$folder}@2x/*.png"); // Generates a second sprite containing every icon @2x resolution.
@wanderingmatt
wanderingmatt / Preferences.sublime-settings
Created August 14, 2012 20:22
User Settings for Sublime Text 2
{
"theme": "Soda Dark.sublime-theme",
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"font_face": "Ubuntu Mono",
"font_options":
[
"subpixel_antialias"
],
"font_size": 14.0,
"fold_buttons": false,
$(".video").fancybox({
aspectRatio: true,
beforeLoad: function() {
this.title = $(this.element).children('aside').html();
this.tpl.prev = "<a title='Previous' class='fancybox-nav fancybox-prev'>The Previous Title</a>";
this.tpl.next = "<a title='Next' class='fancybox-nav fancybox-next'>The Next Title</a>";
console.log($(this.element).parent().next().children());
},
height: 540,
loop: false,
<li>
<a class="thumbnail video fancybox.iframe" rel="commercial" href="http://player.vimeo.com/video/40788896?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1">
<img src="/images/thumbnails/money-cant-buy-style.jpg" alt="Money Can't Buy Style &bull; Kmart" />
<aside>
<hgroup>
<h4>Money Can't Buy Style</h4>
<h5>Kmart &bull; Peterson Milla Hooks</h5>
</hgroup>
</aside>
</a>
<rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:flickr="urn:flickr:" version="2.0">
<channel>
<title>Matthew Anderson's favorites</title>
<link>http://www.flickr.com/photos/matthew-anderson/favorites/</link>
<description>Matthew Anderson's favorites on Flickr.</description>
<pubDate>Wed, 26 Aug 2009 13:51:28 -0700</pubDate>
<lastBuildDate>Wed, 26 Aug 2009 13:51:28 -0700</lastBuildDate>
<generator>http://www.flickr.com/</generator>
def @wb.puts *args; end
def test_puts_got_called
def @wb.puts arg
@putss ||= []
@putss << arg if arg
@putss
end
@wb.recipe do
test "sort should return the correct order" do
actual = Event.sort(1, 'groups.name')
# puts actual
expected = [
events(:three).id,
events(:two).id,
events(:four).id,
events(:five).id,
events(:one).id,