Skip to content

Instantly share code, notes, and snippets.

@getify
getify / 1-CalendarItem.js
Last active March 21, 2024 09:11
an illustration (non-trivial example) of many newer JS class features
// abstract class, not intended to be instantiated directly
class CalendarItem {
static #UNSET = Symbol("unset")
static #isUnset(v) {
return v === this.#UNSET;
}
static {
for (let [idx,msg] of [
"ID is already set.",
"ID is unset.",
@MaxXor
MaxXor / gpu-passthrough.md
Created October 29, 2017 14:47
Arch GPU Passthrough Summary

Arch Linux GPU-Passthrough

A quick guide on how to setup a GPU-Passthorugh. Below are some of my Resources

The Arch Wiki is the goto place for additional information and performance tweaks like CPU-Pinning.

Requirements

  • IGPU or second dedicated GPU for Host system (unless you want to go the hard way and use one GPU for HOST and GUEST)
@rmhsilva
rmhsilva / MacOS trackpad.md
Last active May 19, 2025 09:53
Accessing raw multitouch trackpad data (MacOS)
@bakkiraju
bakkiraju / gist:bed042bb7f659fd99c748c7a32b835d5
Created February 7, 2017 06:47
Always on the Top, click through transparent window in Swift
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
@howlingblast
howlingblast / gist:5814547
Created June 19, 2013 14:00
CoffeeScript: getter/setter example
Function::property = (prop, desc) ->
Object.defineProperty @prototype, prop, desc
class Person
constructor: (@firstName, @lastName) ->
@property 'fullName',
get: -> "#{@firstName} #{@lastName}"
set: (name) -> [@firstName, @lastName] = name.split ' '
p = new Person 'Leroy', 'Jenkins'
@justinrainbow
justinrainbow / install-rabbitmq.sh
Last active May 20, 2017 23:15
Simple bootstrap script for getting RabbitMQ w/ the Stomp plugin and web management plugin running on a SmartOS box
#!/bin/bash
pkgin -y in rabbitmq
rabbitmq-plugins enable rabbitmq_stomp rabbitmq_management
cat > /opt/local/etc/rabbitmq/rabbitmq-env.conf <<-EOF
RABBITMQ_NODENAME=rabbit
RABBITMQ_HOME=/var/db/rabbitmq
EOF
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//