Skip to content

Instantly share code, notes, and snippets.

View JezDriver's full-sized avatar

Jeremy Driver JezDriver

View GitHub Profile
@akshayverma1
akshayverma1 / BootCamp Driver Installation Guide.md
Last active February 12, 2026 10:48
How to get Apple peripherals to work on a Windows PC

How to get Apple peripherals to work on a Windows PC

Published: 8 February, 2024

This guide will help you get your Apple Studio Display, ProDisplay XDR, Magic Keyboard, Magic Mouse, Magic Trackpad, etc. to work with a Windows 11 PC that doesn’t have native support for BootCamp. I wrote this guide because most methods that I could find elsewhere were either out of date, had sketchy download links, had compatibility issues with Windows 11 version 23H2, didn't support Windows Precision Touchpad, didn’t support all the modules in the BootCamp app, or didn’t explain how to get the most up to date Apple official drivers.

Please note that to get Apple displays to work will require either a thunderbolt output from your graphics card or the right DisplayPort to USB-C cable. Please refer to other guides elsewhere to find out what hardware you’ll need.


Preliminary installation

@yoriiis
yoriiis / get-css-transition-duration.js
Last active February 26, 2025 15:00
Get CSS transition duration in second or millisecond
function getCSSTransitionDuration ({
element,
ms = false
}) {
return (parseFloat(window.getComputedStyle(element).transitionDuration)) * (ms ? 1000 : 1)
}
getCSSTransitionDuration({
element: document.querySelector('header')
}); //0.25
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active February 6, 2026 18:57
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@apisandipas
apisandipas / share-urls.md
Last active August 3, 2025 16:23 — forked from chrisl8888/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@JMichaelVelasquez
JMichaelVelasquez / migration-bitbucket-to-github
Created November 27, 2016 21:03
Migrating from BitBucket to GitHub
If you’re anything like me who didn't want to pay for github before their new business strategy, then most likely you use BitBucket or hosted your own (come ‘on, it was free!). Problem with that is now your activities or contributions are fragmented between the different services. Now that I've chosen GitHub, I found myself migrating the git repos.
Here is my copy and paste script I use for migration which also carries your history, which without it, defeats the purpose of it!
$ cd ~/Sites/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin git@github.com:JMichaelVelasquez-change-user/your-new-repo.git
$ git push origin master
@mattclements
mattclements / function.php
Last active January 23, 2026 16:08
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@vyspiansky
vyspiansky / set-user-agent-file_get_contents.php
Last active January 26, 2026 17:22
PHP: set user agent using file_get_contents()
<?php
$options = array('http' => array('user_agent' => 'custom user agent string'));
$context = stream_context_create($options);
$response = file_get_contents('http://domain/path/to/uri', false, $context);
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@jakebellacera
jakebellacera / css_time_to_milliseconds.js
Created February 27, 2014 22:45
CSS Time to Milliseconds - useful for timing functions around CSS animations
/*
* CSS Time to Milliseconds
* by Jake Bellacera (http://jakebellacera.com)
* ============================================
*
* Converts CSS time into milliseconds. Useful for timing functions around CSS animations.
* It supports both seconds (s) and milliseconds (ms).
*
* Arguments:
* time_string - string representation of a CSS time unit (e.g. "1500ms" or "1.5s")
@aderaaij
aderaaij / yoast
Last active February 7, 2025 14:26
Wordpress - Move yoast seo boxes to bottom of post/page
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');