This file contains 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 php | |
<?php | |
/* | |
* This script compiles a set of MCP template files into a JSON object for export. | |
* It reads the content of each file and adds it to the JSON object. | |
* The output is printed to the console, you can pipe it to pbcopy then paste it | |
* into the MCP template editor | |
* | |
*/ |
This file contains 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
// Tiny debounce | |
interface DebounceFunction { | |
(callback: (...args: any[]) => void, frequency?: number, timer?: number | null): (...args: any[]) => void; | |
} | |
export const debounce: DebounceFunction = (callback, frequency = 250, timer: number | null = null) => { | |
return (...args: any[]) => ( | |
clearTimeout(timer!), (timer = setTimeout(function () { | |
callback(); | |
}, frequency, ...args)) |
This file contains 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 sha1(r) { | |
var o, e, t, f, n, a = [], c = [e = 1732584193, t = 4023233417, ~e, ~t, 3285377520], | |
u = [], d = decodeURI(encodeURI(r)) + "", g = d.length; | |
for (u[r = --g / 4 + 2 | 15] = 8 * g; ~g;) u[g >> 2] |= d.charCodeAt(g) << 8 * ~g--; | |
for (o = g = 0; o < r; o += 16) { | |
for (e = c; g < 80; e = [e[4] + (a[g] = g < 16 ? ~~u[o + g] : 2 * d | d < 0) + 1518500249 + [t & f | ~t & n, d = 341275144 + (t ^ f ^ n), 882459459 + (t & f | t & n | f & n), d + 1535694389][g++ / 5 >> 2] + ((d = e[0]) << 5 | d >>> 27), d, t << 30 | t >>> 2, f, n]) d = a[g - 3] ^ a[g - 8] ^ a[g - 14] ^ a[g - 16], t = e[1], f = e[2], n = e[3]; | |
for (g = 5; g;) c[--g] += e[g]; | |
} | |
for (d = ""; g < 40;) d += (c[g >> 3] >> 4 * (7 - g++) & 15).toString(16); | |
return d; |
This file contains 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
class Post_Title_Condition extends Carbon_Fields\Container\Condition\Condition | |
{ | |
/** | |
* Check if the condition is fulfilled | |
* | |
* @param array $environment | |
* @return bool | |
*/ |
This file contains 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 class=container> | |
<ol class='in items'> | |
<li>Item</li> | |
<li>Item</li> | |
<li>Item</li> | |
<li>Item</li> | |
<li>Item</li> | |
<li>Item</li> | |
<li>Item</li> |
This file contains 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 monitor = document.createElement('frame-rate'); | |
monitor.style.position = 'fixed'; | |
monitor.style.backgroundColor = 'white'; | |
monitor.style.width = '84px'; | |
monitor.style.height = '75px'; | |
monitor.style.zIndex = '1000'; | |
document.getElementsByTagName('body')[0].append(monitor); |
This file contains 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 | |
/** | |
* $collection = collect([ | |
* [ | |
* 'name' => 'Chris' | |
* ], | |
* [ | |
* 'name' => 'Monica' | |
* ] |
This file contains 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/sh | |
PHP_MSSQL_DRIVERS=Ubuntu2004-8.0 | |
PHP_MSSQL_RELEASE=5.11.0 | |
# Download and extract phpmysql drivers | |
sudo wget "https://github.com/Microsoft/msphpsql/releases/download/v${PHP_MSSQL_RELEASE}/${PHP_MSSQL_DRIVERS}.tar" -O - | tar -x | |
# Change Directory | |
cd $PHP_MSSQL_DRIVERS |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" > | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen - Sticky zoom video on scroll intersection observer with scrubbing</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="./style.css"> | |
</head> | |
<body> | |
<!-- partial:index.partial.html --> |
This file contains 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 | |
class GreenhouseJobs { | |
public static function get_most_recent_jobs($how_many, $categories = NULL) { | |
$all_jobs = static::get_jobs(); | |
$jobs = []; |
NewerOlder