Skip to content

Instantly share code, notes, and snippets.

View tarngerine's full-sized avatar
🇹🇼
bloo bloo blee blah

Julius Tarng tarngerine

🇹🇼
bloo bloo blee blah
  • freelance highly interactive multiplayer spatial interface prototyping
  • dallas
  • X @tarngerine
View GitHub Profile
@tarngerine
tarngerine / server.js
Created May 26, 2022 21:11
simple websocket server
const express = require('express'),
http = require('http'),
app = express(),
server = http.createServer(app),
path = require('path'),
WebSocket = require('ws');
const wss = new WebSocket.Server({ server, path: '/ws' });
const clients = {}; // Record<UUID, WebSocket>
00:33:49 3DPrimitivesExample $ emmake make
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/Users/tarng/Code/emsdk/upstream/emscripten/cache/is_vanilla.txt" for subsequent builds)
cache:INFO: - ok
make: make
Compiling OF library for Release
Done!
Compiling 3DPrimitivesExample for Release
Linking bin/3DPrimitivesExample.html for emscripten
// A Huge Hack to "support" iframes for iOS devices
// On widget load, set iframe height manually to timeline height
// To support [Load More] button, adjust height on every touch/click event
// Using this on desktop as well to minimize areas to debug
let updateIframeHeight = (iframe) => {
let viewport = iframe.contentDocument.documentElement.getElementsByClassName("timeline-Viewport")[0];
viewport.style.overflow = "hidden";
let timeline = iframe.contentDocument.documentElement.getElementsByClassName("timeline-TweetList")[0];
iframe.style.height = timeline.offsetHeight + 64; // Load button height

Keybase proof

I hereby claim:

  • I am tarngerine on github.
  • I am tarngerine (https://keybase.io/tarngerine) on keybase.
  • I have a public key ASB8y-VtxpL6isvtJ9OZ5Stjz4wBjjEAD2YKNSq5zAf5igo

To claim this, I am signing this object:

@tarngerine
tarngerine / updateLineBehavior.sketchplugin
Created July 15, 2015 18:02
Force New Line Behavior Sketch Plugin
// Paste this into Plugins > Run Custom Plugin...
var allLayers = context.document.currentPage().children();
for(var i = 0; i < allLayers.count(); i++) {
if(allLayers[i].class() == 'MSTextLayer') {
// Set New Line Behavior
allLayers[i].setPrimitiveUsesNewLineSpacingBehaviour(true);
// Reset string value to trigger refresh
allLayers[i].setStringValue(allLayers[i].stringValue())
@tarngerine
tarngerine / inter-browser-saturated-color-fix.css
Created April 17, 2013 23:27
Hack to fix inter-browser saturated color display
/* force hardware acceleration to always be on. stick this div in the HTML wherever */
.force-hardware-acceleration {
-webkit-transform: translate3d(0, 0, 0);
}
/* forcing hardware acceleration on makes safari freak out and render fonts as antialiased instead of the default subpixel-antialiased */
body {
-webkit-font-smoothing: subpixel-antialiased;
}