Skip to content

Instantly share code, notes, and snippets.

@echasnovski
echasnovski / random-colorscheme.lua
Created September 9, 2022 09:42
Create and apply randomly generated Base16 color scheme
-- Create and apply randomly generated Base16 color scheme
--
-- Prerequisites:
-- - Install 'mini.nvim' (https://github.com/echasnovski/mini.nvim).
-- - Put code inside a Lua file (like '~/.config/nvim/random-colorscheme.lua').
-- - Source that file. Either with `:source <file path>` or with
-- `require('<module name>')` (if put inside 'lua' subdirectory of your
-- config; won't work more than once due to caching).
-- General idea:
@stevemoser
stevemoser / IncompatibleAppsList.plist
Created June 20, 2019 19:38
List of 235 apps incompatible with macOS Catalina 10.15
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IncompatiblePaths</key>
<array>
<dict>
<key>Application Name</key>
<string>Sxs Memory Card Driver</string>
<key>Blurb</key>
@lygaret
lygaret / index.js
Last active January 18, 2023 17:26
ES6 Quasi-Literal for JSX
define(function(require) {
var React = require('react');
var paramRegex = /__(\d)+/;
var parser = new DOMParser();
var errorDoc = parser.parseFromString('INVALID', 'text/xml');
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI;
// turns the array of string parts into a DOM
// throws if the result is an invalid XML document.
@addyosmani
addyosmani / mediatorExample.md
Last active December 15, 2015 01:59
Mediator with Backbone 0.9.10

The Mediator pattern enables communication (mediation) between views using a mediator object.In the latest version of Backbone, the Backbone object itself can be used as a mediator without the need of a seperate helper.

In the following example, triggerSomething in our ToolbarView uses the global event-bus on the Backbone object to broadcast an application wide event somethingHappened with data.

// First view
var ToolbarView = Backbone.View.extend({
  className: ".toolbar",
  events: {
    "click .button":   "triggerSomething"
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@kennethkalmer
kennethkalmer / gist:278814
Created January 16, 2010 13:14
node.js SMTP Server
/*
smtpd.js is SMTP server written for node.js
MIT License
*/
var tcp = require('tcp');
var sys = require('sys');