Skip to content

Instantly share code, notes, and snippets.

View xmelsky's full-sized avatar
:octocat:
Git calm, commit and push

Dmitry Hmel xmelsky

:octocat:
Git calm, commit and push
View GitHub Profile
@Boggin
Boggin / BitLockerSmartCardYubiKey.md
Created January 17, 2021 10:53
Use YubiKey Smart Card for BitLocker on W10

Use YubiKey Smart Card for BitLocker on W10

Create certificate

The certificate will be an Encrypting File System (EFS) self-signed smart card certificate.

  • Control Panel > User Accounts > Manage your file encryption certificates
    Create new and store locally

YubiKey Manager

@UniBreakfast
UniBreakfast / t4timing.js
Last active March 6, 2020 17:45
t4timing.js: any_value.t or just t anywhere for timing in console && return value in-place (in cases with dot)! MUCH more convenient (example in tshowcase.html below!) than console.time(...). And you can label the timings too. Use light version for cleaner output and autocomplete.
// leave only one version and delete the rest, or it will throw a (nonbreaking) error
// full version: with all 11 getters
{
let timestamp, stamper = label => function(custom) {
if (timestamp) {
var ts = timestamp
timestamp = new Event(0).timeStamp
console.log(label || (custom? custom+':' : ''),+(timestamp-ts).toFixed(3))
} else timestamp = new Event(0).timeStamp
@UniBreakfast
UniBreakfast / c4console.js
Last active March 6, 2020 17:46
c4console.js: any_value.c for console.log(value) && return value in-place! MUCH more convenient (example in showcase.html below!) than console.log(...) w/o vars or debugger when all you need is to see what's there at a point. Use light version for cleaner output and autocomplete.
// leave only one version and delete the rest, or it will throw a (nonbreaking) error
// full version: with all 11 getters and time
{
let lastTime
const logger = label => function() {
const time = new Date().toLocaleTimeString('en', {hour12: false})
console.log(time == lastTime? '':lastTime=time, label || '', this.valueOf(),
this instanceof Node? {dir: this}: ''))
return this.valueOf()
@joepie91
joepie91 / express-server-side-rendering.md
Last active April 26, 2025 08:11
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@rniswonger
rniswonger / wp-disable-plugin-update.php
Last active October 22, 2025 21:13
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}