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.
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).
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).
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 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
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 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.
Helper functions to cleanly alter versioned objects in SilverStripe
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
Override the material and texture of default SteamVR HTC Vive controllers in Unity.
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
Shader functions to facilitate rotation of vertex around point with a quaternion (Unity / HLSL / Cg)
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
// Full shader example demonstrating how to use a quaterionion to rotate a vertex around a specific point. Note that this is just a plain
// vanilla unlit shader which includes the necessary functions (see section below) and example code in the vertex shader.
//
// Forked from https://gist.github.com/nkint/7449c893fb7d6b5fa83118b8474d7dcb
// Converted from GLSL to Cg. For help with that, see https://alastaira.wordpress.com/2015/08/07/unity-shadertoys-a-k-a-converting-glsl-shaders-to-cghlsl/
//
// quaternion code from https://github.com/stackgl/gl-quat
// rotation from https://twistedpairdevelopment.wordpress.com/2013/02/11/rotating-a-vector-by-a-quaternion-in-glsl/