This file contains 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 { createElement, DOMElement, ReactNode } from 'react'; | |
import { stringify, BEMEntity } from 'rebem-classname'; | |
export interface BEMFactory { | |
(props: BEMEntity, ...children: ReactNode[]): DOMElement<BEMEntity> | |
} | |
function BEM (props: BEMEntity, ...children: ReactNode[]) { | |
const tag = props.tag || 'div'; |
This file contains 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 controller from './controller.js' | |
import {Computed} from 'cerebral' | |
import {set, copy} from 'cerebral/operators' | |
import inquirer from 'inquirer' | |
controller.addSignals({ | |
pageChanged: [ copy('input:page', 'state:page') ], | |
scaffoldSelected: [ | |
() => console.log('scaffold'), | |
() => { /* services.scaffold(options) */ }, |
This file contains 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
/** | |
* HTML5 / CSS3 Circle with Partial Border | |
* http://stackoverflow.com/q/13059190/1397351 | |
*/ | |
* { margin: 0; padding: 0; } | |
.circle { | |
position: relative; | |
margin: 7em auto; | |
width: 16em; height: 16em; | |
border-radius: 50%; |
// Define state and state updates
function ReduxState (state = Immutable.fromJS({items: []}), action) {
switch (actions.type) {
case 'addItem':
return state.push('items', action.item)
}
return state
}
This file contains 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
const REVISIT_PENALTY = 1.5 | |
const DEADEND_PENALTY = 100000 | |
const directions = ['left', 'right', 'up', 'down'] | |
const visitedScore = {} | |
const getNextCoords = (x, y) => ({ left: [x-1, y], right: [x+1, y], up: [x, y-1], down: [x, y+1] }) | |
const getScore = (x, y) => visitedScore[`${x}:${y}`] || 0 | |
const increaseScore = (x, y, n = 1) => visitedScore[`${x}:${y}`] = getScore(x, y) * REVISIT_PENALTY + n | |
function strategy(move, canMove, x, y, maze) { | |
const nextCoords = getNextCoords(x, y) |
This file contains 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 { useRef, useState, useEffect } from 'react'; | |
// Usage | |
function App() { | |
const [ref, isHovered] = useHover(ref); | |
return ( | |
<div ref={ref}> | |
{isHovered ? '😁' : '☹️'} | |
</div> |
This file contains 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
<!DOCTYPE html> | |
<html | |
lang="en" | |
xmlns="http://www.w3.org/1999/xhtml" | |
prefix="og: http://ogp.me/ns# fb: http://www.facebook.com/2008/fbml" | |
> | |
<head> | |
<meta http-equiv="refresh" content="2;url=https://bb-ui.dev.sg.salondev.net/review/08d7bd31-a7da-46e8-b63a-b47a434e09c0" /> | |
<!-- Facebook Open Graph meta tags | |
documentation: https://developers.facebook.com/docs/sharing/opengraph --> |
This file contains 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
%%private(let keyStringifyRegexp = %re("/([=:@$/])/g")) | |
%%private(let valueStringifyRegexp = %re("/([&;/])/g")) | |
%%private(let keyParseRegexp = %re("/[=:@$]/")) | |
%%private(let valueParseRegexp = %re("/[&;]/")) | |
%%private( | |
let encodeString = (str, regexp) => | |
Js.Global.encodeURI(Js.String2.replaceByRe(str, regexp, "/$1")) | |
) |
This bash script allows you to manually install GNOME extensions from a ZIP file. It's a helpful tool for installing GNOME extensions from local files rather than using GNOME Extensions or other online sources.
-
Save the
install_gnome_extension.sh
script to your local machine. -
Make the script executable:
OlderNewer