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
// Benchmark typeof object.key === 'undefined' to 'key' in object | |
var sys = require("sys") | |
function randomKey(n) { | |
var letters = "abcdefghijklmnopqrstuvwxyz" | |
var key = "" | |
for (var i = 0; i < n; i++) key += letters[Math.floor(Math.random() * 26)] | |
return key | |
} |
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
<template name="index"> | |
{{#each list}}<a href="{{pathFor 'select'}}">{{text}}</a><br>{{/each}} | |
</template> | |
<template name="select"> | |
<a href="/">Home</a> - | |
<a href="/ex2">Select ex2</a> | |
<br><br> | |
<select>{{#each list}} | |
<option value="{{id}}" {{#if selected id}}selected{{/if}}>{{text}}</option> |
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
Test 1: Non-enumerable property by prototype in a Handlebars expression. | |
Expected: «Hello World by prototype» | |
Actual: «» | |
------------------------------------------------------------------------ | |
Test 2: Instance property in a Handlebars expression. | |
Expected: «Hello World by field» | |
Actual: «Hello World by field» | |
------------------------------------------------------------------------ | |
Test 3: Same non-enumerable property in a Handlebars helper. | |
Expected: «Hello World by prototype» |
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
#!/bin/bash | |
# Run this script just before you put the laptop in the bin for security scanning. | |
# You can add the seconds the laptop will be waiting before speaking. The default | |
# is waiting for 180 seconds (3 minutes). | |
# Switch to the login screen, effectively locking the screen. | |
function lockscreen() { | |
/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend | |
} |
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
makeErrorByStatus = function(statusCode, content) { | |
let message = `failed [${statusCode}]`; | |
if (content) { | |
const stringContent = typeof content == "string" ? | |
content : content.toString(); | |
message += ' ' + truncate(stringContent.replace(/\n/g, ' '), MAX_LENGTH); | |
} |
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
// Remove sidebar repeatedly | |
setInterval(function() { | |
const sidebar = document.querySelector('#watch7-sidebar') | |
if (sidebar && sidebar.remove) sidebar.remove() | |
const sidebarModules = document.querySelector('#watch7-sidebar-modules') | |
if (sidebarModules && sidebarModules.remove) sidebarModules.remove() | |
console.log('test') | |
}, 500) | |
// Remove player after it has been stopped |
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
[package] | |
name = "minimal_example" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
bincode = "2.0.0-rc.1" |
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
theme = "nalp" | |
[editor] | |
cursorline = true | |
rulers = [72, 79, 99, 119] | |
#bufferline = "multiple" | |
color-modes = true | |
auto-pairs = false | |
[editor.cursor-shape] |