Skip to content

Instantly share code, notes, and snippets.

@microlith57
microlith57 / enum_parse_with_or.cr
Last active April 23, 2019 04:58
Hack on the Enum struct to allow for `Color.parse("Red | Green")`
struct Enum
def self.parse?(string : String) : self?
parts = string.split("|")
output = new(0)
parts.each do |part|
p = previous_def(part.strip)
return nil if p.nil?
output |= p
end
output
@Jarred-Sumner
Jarred-Sumner / comcast.js
Last active September 7, 2022 01:30
Comcast injects this into webpages to show copyright notices
// Comcast Cable Communications, LLC Proprietary. Copyright 2014.
// Intended use is to display browser notifications for critical and time sensitive events.
var _ComcastAlert = (function(){
return {
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'
, dragObj: {zIndex: 999999}
, browser: null
, comcastCheck: 1
, comcastTimer: null
, xmlhttp: null