Skip to content

Instantly share code, notes, and snippets.

View chrishow's full-sized avatar
😄
Back to work! 🦾

Chris How chrishow

😄
Back to work! 🦾
View GitHub Profile
@chrishow
chrishow / gist:2a4295d6d8f9736eab28cc70b5ffc746
Last active March 9, 2024 08:43
Frame rate monitor web component
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);
@chrishow
chrishow / macro.php
Last active December 21, 2023 12:47
Case insensitive 'where' filter for Laravel Collections
<?php
/**
* $collection = collect([
* [
* 'name' => 'Chris'
* ],
* [
* 'name' => 'Monica'
* ]
@chrishow
chrishow / add_pdo_sqlsrv.sh
Created December 20, 2023 15:15
Adding pdo_sqlsrv support to Homestead for PHP8.0
#!/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
@chrishow
chrishow / index.html
Last active November 16, 2023 13:45
Scrub on scroll video demo, https://codepen.io/chrishow/pen/BaMmyoM
<!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 -->
@chrishow
chrishow / GreenhouseJobs.php
Created October 6, 2023 12:16
Simple class to import jobs from Greenhouse.com API into WordPress
<?php
class GreenhouseJobs {
public static function get_most_recent_jobs($how_many, $categories = NULL) {
$all_jobs = static::get_jobs();
$jobs = [];
@chrishow
chrishow / README.md
Last active December 25, 2015 14:09
Example of embedded spotify player.

Example of embedded spotify player.

@chrishow
chrishow / index.html
Created March 26, 2013 11:09
A CodePen by Chris How. Countdown Clock
<div class="container">
<ul class="flip minutePlay">
<li>
<a href="#">
<div class="up">
<div class="shadow"></div>
<div class="inn">0</div>
</div>
<div class="down">