Scenario: I have two repositories
monorepo
tool
and I want to move the tool
repository into the monorepo
under path packages/tool
with
rewritten history in a way it looks like it has been there all the time.
function maybeGlobal<T extends object>(): Partial<T> | undefined { | |
return (typeof window !== "undefined" ? window : undefined) as any; | |
} | |
maybeGlobal<{ | |
MY_GLOBAL_VARIABLE: string; | |
}>()?.MY_GLOBAL_VARIABLE?.toUpperCase(); |
ni() { | |
# Add packages | |
if [ "${1:-}" != "" ]; then | |
if [ -f pnpm-lock.yaml ] || [ -f ../../pnpm-lock.yaml ]; then | |
pnpm install $@ | |
else | |
npm install $@ | |
fi | |
return | |
fi |
/** | |
* Unwraps the type so it's more readable in vscode tool tips | |
* */ | |
export type Unwrap<T> = T extends object | |
? { | |
[P in keyof T]: Unwrap<T[P]>; | |
} | |
: T; |
<?php | |
register_graphql_connection( [ | |
'fromType' => 'HierarchicalContentNode', | |
'toType' => 'ContentNode', | |
'fromFieldName' => 'ancestors', | |
'description' => __( 'Returns ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).', 'wp-graphql' ), | |
'resolve' => function( Post $post, $args, $context, $info ) { | |
$ancestors = get_ancestors( $post->ID, null, 'post_type' ); | |
if ( empty( $ancestors ) || ! is_array( $ancestors ) ) { | |
return null; |
if input volume of (get volume settings) = 0 then | |
display notification "MIC ON!" | |
set level to 100 | |
else | |
set level to 0 | |
display notification "MUTED MIC!" | |
end if | |
set volume input volume level |
<?php | |
class ActionLogger { | |
static $started; | |
static $prev; | |
static function start() { | |
self::$started = hrtime(true); | |
self::$prev = hrtime(true); | |
add_action('all', [self::class, '__action_all'], 10000); |
<?php | |
namespace Valu\Sakke\GraphQL; | |
use WPGraphQL\AppContext; | |
use GraphQL\Type\Definition\ResolveInfo; | |
use GraphQL\Deferred; | |
/** | |
* Basing on WPGraphQL v0.7 |
env=~/.ssh/agent.env | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { | |
(umask 077; ssh-agent >| "$env") | |
. "$env" >| /dev/null ; } | |
agent_load_env |
{ | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"rules": [ | |
{ | |
"manipulators": [ | |
{ | |
"description": "Section to Backtick (MS keyboard)", | |
"from": { |