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 zeroes out any space not needed for packaging a new Debian Vagrant base box. | |
| # Run the following command in a root shell: | |
| # | |
| # curl -sL https://gist.github.com/stenin-nikita/ad4023fc531bf01bcea3400addfe8244/raw/vagrant-clean.sh | bash - | |
| function print_green { | |
| echo -e "\e[32m${1}\e[0m" | |
| } |
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
| #!/usr/bin/env bash | |
| # run command: | |
| # wget -qO- https://gist.githubusercontent.com/stenin-nikita/069e653666be5612aec509011c2af498/raw/install-packages.sh | DB_ROOT_PASSWORD="secret" DB_USER_PASSWORD="secret" bash | |
| export DEBIAN_FRONTEND=noninteractive | |
| function print_green { | |
| echo -e "\e[32m${1}\e[0m" | |
| } |
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 validator from 'react-verificator' | |
| const mapValidatorToProps = ({ ownProps, validator }) => ({ | |
| validator | |
| }) | |
| @validator({ | |
| rules: { | |
| name: 'required', |
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
| <?php | |
| /* Prototype file of PHP parser. | |
| * Written by Masato Bito | |
| * This file is PUBLIC DOMAIN. | |
| */ | |
| $buffer = null; | |
| $token = null; | |
| $toktype = null; |
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
| <?php | |
| declare(strict_types=1); | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| /** | |
| * Class ApolloUpload |
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
| const EFFECT = Symbol('@@Reatom/EFFECT'); | |
| function createActionCreatorWithEffect(type, effect) { | |
| return (payload) => ({ | |
| type, | |
| payload, | |
| [EFFECT]: (store) => effect(payload, store), | |
| }) | |
| } |
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 { useContext, useEffect } from 'react'; | |
| import { context } from '@reatom/react'; | |
| export function useActionEffect(actionCreator, callback) { | |
| const store = useContext(context); | |
| useEffect(() => store.subscribe(actionCreator, () => callback()), [store, callback]); | |
| } |
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, { FC } from 'react'; | |
| import { useAtom } from '@reatom/react'; | |
| import { declareAtom } from '@reatom/core'; | |
| interface TreeNode { | |
| id: string; | |
| parentId: string | null; | |
| name: string; | |
| children: string[]; | |
| properties: { |
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
| const paths = declareAtom({}, on => [ | |
| on(itemsAtom, (state, items) => { | |
| const ims = values(items); | |
| const paths = {}; | |
| for (const id of ims) { | |
| paths[id] = getPathForItem(id, items); | |
| } | |
| return paths; |
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 { Action } from '@reatom/core'; | |
| export function isAction(arg: any): arg is Action<any> { | |
| return arg && typeof arg === 'object' && typeof arg.type === 'string'; | |
| } |
OlderNewer