Skip to content

Instantly share code, notes, and snippets.

View JonAbrams's full-sized avatar

Jon Abrams JonAbrams

View GitHub Profile

Patches

Game & Watch Gallery [WIP - Not working]

Common Name: Game & Watch Gallery (USA) (SGB Enhanced)
Patch name: Game & Watch Gallery - Pocket.ips
MD5: d5081250257e0dafcb8fe8720fcb9f28
Language: English
Wikipedia
Link to patch

.menu {
overflow: hidden;
}
/* Enable scroll on hover */
.menu:hover {
overflow: auto;
}
/* Enable scroll on focus */
.menu {
overflow: hidden;
}
/* Enable scroll on hover OR focus */
.menu:hover, .menu:focus-within {
overflow: auto;
}
/*
Applies to any element that has
mydiv as a class OR myotherdiv as an id
*/
.mydiv, #myotherdiv {
background-color: red;
}
@JonAbrams
JonAbrams / gist:1bdabf8ae3dc2d132056f1b09cd1c603
Last active January 12, 2019 19:21
Examples for blog post about pseudo-classes
/* Applies to all input elements that are being focused */
input:focus {
border-color: blue;
}
/* Applies to all buttons that are hovered over */
button:hover {
border-color: red;
}
import { subscribe } from 'spaceace';
import { renderApp } from './renderApp';
import { rootSpace } from './rootSpace';
renderApp(rootSpace);
subscribe(rootSpace, ({ newSpace }) => {
// executed whenever rootSpace is updated
// rootSpace is immutable, newSpace is the updated version
const handleRemove = ({ merge, space }, itemToBeRemoved) => {
merge({
items: space.items.filter(item => item !== itemToBeRemoved)
});
};
export const ShoppingCart = ({ space }) => (
<div>
<ul>
{space.items.map(item => (
import { fetchPizza } from '../apiCalls';
/*
handleSubmit is a custom action.
The first parameter is provided by SpaceAce.
The remaining parameters are passed-through
which in this case consists of React's event object
*/
const handleSubmit = async ({ space, merge }, event) => {
event.preventDefault();
export const PizzaForm = ({ space }) => (
<form>
<label>Name</label>
<input
type="text"
value={space.name || ''}
onChange={space('name')} // Whenever user types, `space.name` is updated
/>
<label>Do you like pizza?</label>
<input
import Space, { subscribe } from 'spaceace';
const space = new Space({
appName: "SpaceAce demoe",
user: { name: 'Jon', level: 9001 }
});
subscribe(space, ({ newSpace, causedBy }) => {
console.log(`State updated by ${causedBy}`);
ReactDOM.render(