You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Pushing 1's and 0's.
Patrick Nelson
patricknelson
Pushing 1's and 0's.
Full stack web developer @eBay, builder of all things web.
Helper functions to cleanly alter versioned objects in SilverStripe
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 to split arrays up into chunks to do work on (basically pagination for callbacks).
doChunks()
Very simple but useful PHP function for performing work on large arrays of information. Basically, it's like pagination for
callbacks. For example, this can be used for performing bulk database INSERT operations (instead of inserting each
item individually). See below for a quick real world example.
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
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
Can't go to full screen easily? On a website and hate their customized version of a video player and just wish you could use the one built into your device or browser? It turns out there's a solution: In many cases, you can actually bypass this by simply taking the <video> element on the page and forcing it to go to full screen immediately with a single press using a simple bookmark (or, a bookmarklet to be precise).
Instructions
Create a bookmark, call it Full screen and copy/paste the following into the URL field:
This reverts the shitty wrapper that Reddit forces on you when you try to view images on their website. This is done via a bookmarklet (see URL below).
Create a new bookmark, copy/paste this code into it and then whenever you visit an i.redd.it image link and get redirected,
this will fix the page so that it's just the image. Saving you from the varous bugs/issues induced by their platform (such
as the header or footer overlapping the image itself when you attempt to zoom in on the image).
kubectl-sure: Provide confirmation when in sensitive contexts
kubectl-sure: Provide confirmation when in sensitive contexts
This bash function provides an extra failsafe that may help prevent you from accidentally running kubectl commands in the wrong context (or in
contexts which could cause issues, such as shared or even production clusters).