Skip to content

Instantly share code, notes, and snippets.

View thehappycoder's full-sized avatar

Anton Kuzmin thehappycoder

  • Brisbane, Australia
View GitHub Profile
@thehappycoder
thehappycoder / path.ts
Last active June 8, 2018 23:27
Typesafe path function as an alternative to safe navigation operator
// Need to use this special type so that keyof would work
export type TheType<T> = Required<NonNullable<T>>
export function path<P extends keyof TheType<T>, T>(
props: [P],
obj: T
): PropType<P, T>
export function path<
P extends keyof TheType<T>,
<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
<dict>
<key>PayloadDisplayName</key>
<string>Telstra IPv6 Profile</string>
<key>PayloadIdentifier</key>
<string>ipv6.telstra.apn.saltspork.com</string>
Index: app/assets/javascripts/blueimp-gallery.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/assets/javascripts/blueimp-gallery.js (revision 328:c900ca71ecec0ce23ead18ab66d10b1404191483)
+++ app/assets/javascripts/blueimp-gallery.js (revision )
@@ -154,6 +154,7 @@
// The event object for which the default action will be canceled
// on Gallery initialization (e.g. the click event to open the Gallery):
@thehappycoder
thehappycoder / gist:5106953
Created March 7, 2013 10:08
celluloid and ObjectSpace.each_object
require 'celluloid'
class Child
include Celluloid
include Celluloid::Logger
def start(cycle, n)
info "#{cycle}:#{n} started..."
if n == 2