Skip to content

Instantly share code, notes, and snippets.

@ryexley
ryexley / index.jsx
Created July 30, 2024 17:57
Radix UI Tabs component with Select component as mobile fallback
import cx from "clsx"
import { useEffect, useState } from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
import { Icon } from "~/components/icon"
import { Select } from "~/components/select"
import { isNotEmpty } from "~/util"
import styles from "./styles.css"
/**
*
@ryexley
ryexley / new-macos-10.md
Created September 25, 2020 13:10 — forked from theantichris/new-macos-10.md
Steps for setting up new machines.
@ryexley
ryexley / blog-footer.js
Last active February 9, 2021 16:31
Ghost blog code injection - This contains both "Blog Header" and "Blog Footer" code injection blocks that supports customization of the default Ghost theme, Casper. The custom styling for the header fixes a wrapping/horizontal scrolling issue for code samples in the default theme, and the JavaScript for the footer enables/renders Disqus comments…
@ryexley
ryexley / data-requirements.md
Last active August 29, 2015 14:00
UI/UX development requirements artifacts

Data Requirements

This document should outline the details of the dynamic data that the application will consume, the source it will come from, access details and format information, etc.


Search

http://example.com/api/search
@ryexley
ryexley / app.js
Created October 17, 2012 13:37
How I organize my JavaScript code blog post code samples
(function (w) {
w.Yarder = {
Models : {},
Views : {},
Collections : {},
Routers : {},
Templates : {},
Api : {
Resources : {}
@ryexley
ryexley / grunt.js
Created October 2, 2012 01:47
Example Grunt script
module.exports = function (grunt) {
grunt.initConfig({
pkg : '<json:package.json>',
meta : {
banner : '// <%= pkg.name %>, v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
'// https://github.com/ryexley/yarder\n'
},
(function(c, api, util) {
c.FilterableCollection = function (collection) {
var filtered = new collection.constructor();
// Expects an object/hash argument that looks like the following example:
// criteria : { value : 'stringToSearchFor', fields : ['field1', 'field2'] }
filtered.filterLike = function (criteria) {
var items;
var match;
@ryexley
ryexley / gist:3492140
Created August 27, 2012 20:55
Backbone.js SortableCollection
(function (w) {
w.SortableCollection = Backbone.Collection.extend({
initialize : function () {
_.bindAll(this);
},
sortInfo : [],
comparator : function (a, b) {