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
// If this code is transpiled by the TypeScript compiler, it will echo "You are using TypeScript" | |
// If this code is ran as-is, it will echo "You are using JavaScript" | |
console.log(new Set<String>('1') ? 'You are using TypeScript' : 'You are using JavaScript') | |
// This is actually valid JavaScript code: properly formatted, it looks like that: | |
// (new Set) < (String) > ('1') | |
// In TypeScript, the angle brackets after Set are interpreted as generic types, which is why the result is different. |
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 priority = ['mozilla.org']; | |
const blocklist = ['w3schools']; | |
const resultNode = document.getElementById('rso'); | |
// Sort results | |
const sorted = [...resultNode.children] | |
.filter((child) => { | |
const href = child.querySelectorAll('a')?.[0]?.href; | |
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 | |
$finder = PhpCsFixer\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->notName('*.blade.php') | |
->ignoreDotFiles(true) |
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 | |
errors=false | |
screenshot_path=/tmp/screenshot.jpeg | |
default_client_id=c9a6efb3d7932fd | |
client_id="${IMGUR_CLIENT_ID:=$default_client_id}" | |
# Save as a file | |
xclip -se c -t image/jpeg -o > $screenshot_path 2>/dev/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
<template> | |
<section | |
:class="[ | |
'mb-16 mx-16', | |
'absolute inset-x-0 bottom-0 z-50', | |
'flex justify-center', | |
'transition-opacity duration-1000', | |
!hasFlashes && 'opacity-0', | |
]" | |
> |
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
.title.breadcrumbs { | |
display: none !important; | |
} | |
.window-title { | |
visibility: hidden !important; | |
} | |
.monaco-editor .scroll-decoration, | |
.scroll-decoration { |
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 { flags } = require('@oclif/parser'); | |
module.exports = { | |
actions: () => [], | |
parse: () => ({ | |
flags: { | |
auth: flags.boolean({ char: 'f' }), | |
}, | |
args: [ | |
{ |
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 withAlphaVariable({ color, property, variable }) { | |
if (_.isFunction(color)) { | |
return { | |
[property]: color(variable), | |
} | |
} | |
try { | |
const [r, g, b, a] = toRgba(color) |
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
.touch-none { | |
touch-action: none; | |
} | |
.touch-auto { | |
touch-action: auto; | |
} | |
.touch-pan-x { | |
touch-action: pan-x; |