$ ember install ember-cli-postcss # Install ember-cli-postcss
$ npm install --save-dev tailwindcss # Install tailwindcss
$ npx tailwind init app/styles/tailwind.config.js # Optional: Generate a Tailwind config file for your project
$ npm install -save-dev postcss-import # Optional: If you want to use the @import statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Treemap</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script> | |
<style type="text/css"> | |
rect { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# ==> Configuration for any authentication mechanism | |
# Configure which keys are used when authenticating a user. The default is | |
# just :email. You can configure it to use [:username, :subdomain], so for | |
# authenticating a user, both parameters are required. Remember that those | |
# parameters are used only when authenticating and not when retrieving from | |
# session. If you need permissions, you should implement that in a before filter. | |
# You can also supply a hash where the value is a boolean determining whether | |
# or not authentication should be aborted when the value is not present. | |
config.authentication_keys = [ :login ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooController | |
respond_to :csv | |
def index | |
@foos = Foo.scoped | |
if stale?(:last_modified => Foo.something) | |
respond_with @gta do |format| | |
format.csv { stream_csv @foo } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
/** | |
* Our component structure will look like the following: | |
* - WikiBox | |
* -- AutoCompleteBox | |
* --- AutoComplete | |
*/ | |
// this component renders a single entity coming from wikipedia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function() | |
{ | |
var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', { | |
preload: preload, | |
create: create, | |
update: update | |
}); | |
var dragging = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BC.registerElement "bc-require", | |
createdCallback: -> | |
@setAttribute("pending", "") | |
attachedCallback: -> | |
BC.ready => | |
if Loader.find(@script)?.loaded | |
@activate() | |
else | |
@deactivate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import produce from 'immer'; | |
import {createStore} from 'redux'; | |
const handleActions = (actionsMap, defaultState) => ( | |
state = defaultState, | |
{type, payload} | |
) => | |
produce(state, draft => { | |
const action = actionsMap[type]; | |
action && action(draft, payload); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parallel implementation to Avatar example from | |
// https://github.com/conorhastings/use-reducer-with-side-effects/blob/19d097e95302068d8368b0a10b379b0a6bab9f93/README.md | |
import { useObserver, useLocalStore } from 'mobx-react'; | |
// WIP library inspired by `import { promisedComputed } from 'async-computed-mobx'` | |
import asyncComputed from 'utils/mobx/asyncComputed'; | |
const DEFAULT_AVATAR = '/assets/img/default-avatar.png'; | |
function Avatar(props: { userName: string }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { types, IAnyModelType, Instance, cast } from "mobx-state-tree"; | |
import React, { useMemo } from "react"; | |
export const createModel = <T extends IAnyModelType>( | |
model: T, | |
value?: Record<string, any> | |
) => types.optional(model, () => model.create(value)); | |
export function castSelf<IStoreInstance, IParentModel>( | |
store: IStoreInstance, |
OlderNewer