View this_test.js
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
const this_test = { | |
returns_global_this() { | |
function inner() { | |
// even unbound inner function's | |
// this context is globalThis. | |
return this; | |
} | |
return inner(); | |
}, | |
returns_local_this() { |
View memoize.py
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
# -*- coding: utf-8 -*- | |
# memoize support for plone.subrequest subrequests. | |
# usage: | |
# >>> import ./memoize | |
# >>> from ./memoize import instance_memoize | |
# >>> @memoize.parent_request_memoize | |
# >>> def _results(self): | |
# >>> return "expensive calculation" | |
# >>> |
View validitytest.js
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
let form = document.createElement('form'); | |
let el = document.createElement('input'); | |
el.setAttribute('type', 'date'); | |
el.setAttribute('name', 'okay'); | |
form.appendChild(el); | |
document.body.appendChild(form); | |
let input = document.querySelector('form input'); | |
input.value = 'lsk'; | |
console.log(input.validity.valid); // says ``true``, should be ``false`` |
View package.json
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
{ | |
"name": "npm-tools", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"dependencies": { | |
"@angular/cli": "*", | |
"@vue/cli": "*", | |
"babel-eslint": "", | |
"bash-language-server": "", |
View earchwallpaper.sh
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 | |
# | |
# Changes the wallpaper hourly and displays a projection of the earth with | |
# a semi-realistic rendered sunglight mapping. | |
# | |
# This script will download hourly the "World Sunlight Map" by die.net. | |
# You can choose the world_sunlight_wallpaper.jpg picture as background image for your Desktop. | |
# Gnome recognizes file changes and updates the background accordingly. | |
# | |
# See: |
View remove-broken-contentrule.py
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 a broken contentrule after deinstalling ``collective.contentrules.comingsoon`` | |
""" | |
# Create Fake Interface | |
from zope.component.interfaces import IObjectEvent | |
class IComingSoon(IObjectEvent): pass | |
# Create Fake Module | |
import sys |
View registry.xml
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
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n"> | |
<!-- Add ``object_provides`` criteria to query string for use in collections. | |
Put code in ``registry.xml`` and create a .tar.gz, then upload it via | |
portal_setup and make sure to untick "Purge existing settings". --> | |
<records interface="plone.app.querystring.interfaces.IQueryField" | |
prefix="plone.app.querystring.field.object_provides"> | |
<value key="title">object_provides</value> | |
<value key="description">Search for provided interfaces</value> | |
<value key="enabled">True</value> | |
<value key="sortable">True</value> |
View upgrades.py
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
# -*- coding: utf-8 -*- | |
from zope.component.hooks import getSite | |
import logging | |
log = logging.getLogger(__name__) | |
def unregister_broken_persistent_components(context): | |
portal = getSite() | |
sm = portal.getSiteManager() |
View earthwallpaper.sh
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 | |
# | |
# Changes the wallpaper hourly and displays a projection of the earth with | |
# a semi-realistic rendered sunglight mapping. | |
# | |
# Via: http://www.webupd8.org/2009/09/real-time-earth-wallpaper-for-linux.html | |
# More Info: | |
# - https://www.die.net/earth/rectangular.html | |
# - https://www.die.net/earth/how.html | |
# |
View togglescrolling.sh
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/sh | |
# Toggle touchpad scrolling on Gnome 3 via dconf/gsettings between | |
# 'two-finger-scrolling' and 'edge-scrolling'. | |
# This can be useful for touchpad users using two-finger-scoll and want | |
# to open the context menu via two-finger-click on the right position. | |
CURRENT=$(gsettings get org.gnome.desktop.peripherals.touchpad scroll-method) | |
echo $CURRENT |
NewerOlder