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 | |
/** | |
* Instructions: | |
* In an Object Resolve function, use the fourth argument ($info) | |
* | |
* Example usage: | |
* | |
* $fieldInQuery = GraphQLQueryChecker::isFieldInQuery('some.nested.fieldname', $info); | |
* |
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
/* | |
// Example usage | |
var myElement = document.getElementById('my-element'); | |
var modalFadeInDuration = 300; | |
focusAndOpenKeyboard(myElement, modalFadeInDuration); // or without the second argument | |
*/ | |
function focusAndOpenKeyboard(el, timeout) { | |
if(!timeout) { | |
timeout = 100; |
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 | |
function execAndPipeOutput($cmd) | |
{ | |
echo PHP_EOL; | |
$proc = proc_open($cmd, [['pipe','r'],['pipe','w'],['pipe','w']], $pipes); | |
while(($line = fgets($pipes[1])) !== false) { | |
fwrite(STDOUT, $line); | |
} | |
while(($line = fgets($pipes[2])) !== false) { |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
#Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
; Screenshot (you still have to paste it into paint or whatever) | |
>#+3::Send {PrintScreen};^+3 | |
>#+4::Send {PrintScreen};^+4 | |
<#+3::Send {PrintScreen};^+3 | |
<#+4::Send {PrintScreen};^+4 |
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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
// Nodeland | |
interface ExtendedGlobal extends NodeJS.Global { | |
someGlobalKey: string | |
} | |
export const extendedGlobal: ExtendedGlobal = global as any | |
// Browserland |
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 path = require('path') | |
const { execSync, spawnSync } = require('child_process') | |
const prettier = require('prettier') | |
const fs = require('fs') | |
const micromatch = require('micromatch') | |
const lockfile = path.resolve(__dirname, 'linter-script-lockfile') | |
const eslintFileTypes = ['js', 'jsx', 'ts', 'tsx'] |
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 path = require('path') | |
const { execSync, spawnSync } = require('child_process') | |
const fs = require('fs') | |
const micromatch = require('micromatch') | |
const lockfile = path.resolve(__dirname, 'linter-script-lockfile') | |
const eslintFileTypes = ['js', 'jsx', 'ts', 'tsx'] | |
function readGlobsFromFile(filename) { |
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
// Instead of using the <Prompt />'s implementation | |
// (which uses the browser's 'confirm()',) use your own custom component! | |
import React, { useState, useEffect, useRef } from 'react' | |
import { useHistory } from 'react-router-dom' | |
import { Modal } from './Modal' // your custom component | |
interface CustomPromptProps { | |
when: boolean | |
onConfirmNavigation?: () => void |
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
function copyToClipboard(textToCopy: string): void { | |
const tmpInputEl = document.createElement('input') | |
tmpInputEl.value = textToCopy | |
tmpInputEl.type = 'text' | |
tmpInputEl.style.position = 'absolute' | |
tmpInputEl.style.left = '9000vw' | |
document.body.appendChild(tmpInputEl) | |
tmpInputEl.select() | |
document.execCommand('copy') | |
document.body.removeChild(tmpInputEl) |
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
interface Participant { | |
readonly name: string | |
assignment?: Participant | |
} | |
const allParticipants: Participant[] = [ | |
{ name: 'Nate' }, | |
{ name: 'Kyle' }, | |
{ name: 'Zach' }, | |
{ name: 'Bryce' }, |
OlderNewer