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
| using System; | |
| using Godot; | |
| using Godot.Collections; | |
| using ProjectTome.Utils; | |
| namespace ProjectTome.Core.StateMachine; | |
| [GlobalClass] | |
| public partial class StateMachine : Node | |
| { |
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 React from 'react'; | |
| // slot config allows 2 options: | |
| // 1. Component to match, example: { leadingVisual: LeadingVisual } | |
| type ComponentMatcher = React.ElementType<Props>; | |
| // 2. Component to match + a test function, example: { blockDescription: [Description, props => props.variant === 'block'] } | |
| type ComponentAndPropsMatcher = [ComponentMatcher, (props: Props) => boolean]; | |
| export type SlotConfig = Record< | |
| 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 * as fs from "fs"; | |
| export function memoryUsageLog( | |
| file: string | Writable, | |
| sampleRate: number = 1, | |
| sampleTime: number = 60, | |
| debug: boolean = false, | |
| callback = () => {} | |
| ) { | |
| const output = typeof file === "string" ? fs.createWriteStream(file) : file; |
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 { Observable, merge, interval } from "rxjs"; | |
| import { map, tap, pluck } from "rxjs/operators"; | |
| type KV = Record<any, any>; | |
| interface Cacheable<K, V> { | |
| delete: () => void; | |
| get: (key: K) => V | undefined; | |
| has: (key: K) => boolean; | |
| set: (key: K, value: V) => this; |
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
| #!/bin/bash | |
| # This script assumes that you have the following installed | |
| # npm 5.2+ [https://www.npmjs.com/get-npm] | |
| # hub [https://hub.github.com/] | |
| if [ "$1" != "" ]; then | |
| echo "Generating new node project $1..." |
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
Show hidden characters
| { | |
| "Use State": { | |
| "prefix": "us", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState($2);", | |
| "$0" | |
| ], | |
| "description": "(EXPERIMENTAL) React: Use State. See https://reactjs.org/hooks" | |
| } |
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
| type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | |
| export function withAppContext< | |
| P extends { appContext?: AppContextInterface }, | |
| R = Omit<P, 'appContext'> | |
| >( | |
| Component: React.ComponentClass<P> | React.StatelessComponent<P> | |
| ): React.SFC<R> { | |
| return function BoundComponent(props: R) { | |
| return ( |
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
| package main | |
| import ( | |
| "crypto/md5" | |
| "io" | |
| "github.com/fogleman/gg" | |
| ) | |
| type gridCell struct { |
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 React, { Component } from 'react'; | |
| import { number, string } from 'prop-types'; | |
| export const { Provider, Consumer } = React.createContext(); | |
| export const locationConsumer = Component => props => { | |
| return ( | |
| <Consumer> | |
| { ctx => <Component {...ctx} {...props}/> } |
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
| <div ng-app="myApp" ng-controller="myController" ng-cloak > | |
| <form autocomplete="off"> | |
| <div class="input" ng-click="setFocus()"> | |
| <ul class="tokens"> | |
| <li arrow-lr class="token" ng-repeat="company in selected | limitTo:screenLimit" ng-click="removeThisCompany(company.id)" ng-keydown="removeFocused(this, $event)" data-tooltip="{{company.name}}" tabindex="-1">{{company.name | myFilter }}</li> | |
| <li arrow-lr ng-if="selected.length > screenLimit" class="leftovers" tabindex="-1"> | |
| {{selected.length - screenLimit}} more... | |
| <ul> | |
| <li class="leftover" ng-repeat="company in selected | startFrom: screenLimit" ng-click="removeThisCompany(company.id)"> | |
| {{company.name}} |
NewerOlder