Skip to content

Instantly share code, notes, and snippets.

@darionco
darionco / preHTML.ts
Last active December 19, 2020 03:42 — forked from AStaroverov/gist:56448f9baa560b4b7489ecf8ca0c36c8
preHTML - wrapper function fo dynamic tags lit-html
import {html, TemplateResult} from 'lit-element';
interface CachedNeedlessValue {
value: any;
index: number;
}
interface CachedTemplateStrings {
strings: string[];
needlessValues: CachedNeedlessValue[];
@darionco
darionco / CQJavaScriptBridge.h
Created October 9, 2015 18:05
Automatic Objective-C to JS bridge. Originally from Colloquy
#import <JavaScriptCore/JavaScriptCore.h>
@interface CQJavaScriptObject : NSProxy {
@protected
JSGlobalContextRef _context;
JSObjectRef _object;
}
- (id) initWithScriptObject:(JSObjectRef) object andContext:(JSContextRef) context;
@property (readonly) JSGlobalContextRef context;
@darionco
darionco / P2StaticProperties.h
Created July 25, 2014 19:50
Simple way to create "static properties" in Objective-C
//
// P2StaticProperties.h
// P2
//
// Created by Dario Segura on 3/5/2014.
//
//
// Copyright 2014 Trompo Games Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");