Skip to content

Instantly share code, notes, and snippets.

@owzzz
owzzz / modal.gts
Last active September 8, 2022 03:31
// eslint-disable-next-line ember/use-ember-data-rfc-395-imports
import DS from 'ember-data';
import Component from '@glimmer/component';
import { on } from '@ember/modifier';
import { hash, fn } from '@ember/helper';
import { localCopy } from 'tracked-toolbox';
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
interface Args {
isOpen?: boolean;
<GridListLayout>
<:header>
<GridListLayout::Header>
<GridListLayout::Header::Options>
<OrderSelect
@order={{this.order}}
@options={{this.sortOptions}}
@action={{this.selectOrder}}
/>
</GridListLayout::Header::Options>
<div class="container">
<div class="{{if (has-block "sidebar") 'grid grid-cols-[10vw_1fr]'}} grid-rows-1 h-[calc(100vh_-_360px)] mt-4">
{{#if (has-block "sidebar")}}
<aside class="pr-4 py-4 border-r border-gray-300">
{{yield to="sidebar"}}
</aside>
{{/if}}
<main class="grid grid-cols-1 grid-rows-[auto_1fr_auto] {{if (has-block "sidebar") 'ml-4'}} h-full">
{{#if (has-block "header")}}
@owzzz
owzzz / destructuring.js
Created September 4, 2017 16:42 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@owzzz
owzzz / .gitconfig
Created September 3, 2017 04:33 — forked from maninak/.gitconfig
# delete section if you don't use meld. Everyone's wierd in some way, I don't judge.
[merge]
tool = meld
[branch]
autosetuprebase = always
[push]
default = simple
followTags = true
# Reward JSON
{
reward_metadata: {
status: 'approved',
partner: 'NBA',
rewardType: [{
name: 'd34lh0-09dddd',
value: 'NBA Draw Ticket'
}],
import React, {Component} from 'react';
import styled from 'styled-components';
import theme from '../../utils/theme';
function isSelected(props) {
if(props.selected) {
return `
:after {
position: absolute;
transform: rotate(-45deg);
@owzzz
owzzz / README-Template.md
Created January 13, 2017 16:38 — forked from regexident/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Motivation

test('Basic destructuring assignment', (t) => {
t.plan(5);
let foo = [1,2,3,4,5];
var [one, two, three, four, five] = foo;
t.is(one, 1);
t.is(two, 2);
t.is(three, 3);
import test from 'ava';
test('Destructuring', (t) => {
function foo() {
return [1,2,3];
}
function bar() {
return {