Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / node-inspect-Photoshop-node.sh
Created October 3, 2013 13:59
Use node-inspect Blink inspector GUI with Photoshop-node. Tested on Mac OS X. I'm not sure how to do it on Windows yet.
#!/usr/bin/env bash
kill -s USR1 `pgrep -l Photoshop-node|cut -d" " -f1`
(sleep 1; open -a 'Google Chrome' http://127.0.0.1:8080/debug?port=5858)&
node-inspector
tell application "Google Chrome"
activate
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
if (count every window) = 0 then
make new window
end if
set found to false
set theTabIndex to -1
@subtleGradient
subtleGradient / FramerLayer.NoFlo.js
Last active October 27, 2018 14:27
Quick and dirty Framer Layer component for NoFlo
/**
1. Go to http://app.flowhub.io/
2. Open or create a project
3. Create a new component
4. Paste all this code into the *Implementation* section
5. Switch back to the graph editor
6. Search for this component
* Note: You can't skip this part! There's a bug in the noflo-ui that makes it impossible to insert a component without searching first. This is beta software.
7. Insert an instance of this component
8. Press the play button in the *Preview* section on the right side of the graph editor UI
var $ = require('NodObjC');
module.exports = function(props){
var NSUserNotificationCenterDelegate = $.NSObject.extend('NSUserNotificationCenterDelegate');
NSUserNotificationCenterDelegate.addMethod('init', { retval: '@', args: ['@', ':'] }, function(self) {
$.NSUserNotificationCenter('defaultUserNotificationCenter')('setDelegate', self);
return self;
});
@subtleGradient
subtleGradient / index.js
Created May 27, 2014 02:25
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@subtleGradient
subtleGradient / async-callstack-hack.js
Created August 30, 2014 03:49
Async callstacks for your own custom event system or RPC or whatever
/**
* Created by Thomas Aylott on 2014-08-29
* Copyright 2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@subtleGradient
subtleGradient / dabblet.css
Last active August 29, 2015 14:08 — forked from anonymous/dabblet.css
SixteenColors Prototype
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<!doctype html>
<meta charset=utf-8>
<title></title>
<style>html{font-family:Helvetica Neue,Helvetica,sans-serif;}</style>
<div id=RenderTarget>
<h1>Loading…</h1>
</div>
<script type="text/babel">
@subtleGradient
subtleGradient / Google Sheets Duration functions.gs.js
Last active October 13, 2017 19:30
Custom functions for Google Sheets Duration and time calculations Raw
/**
* Copyright 2017 Thomas Aylott
* MIT License
* https://gist.github.com/subtleGradient/38bc20750bed84d0afc5ff9704379c58
*/
function showError(message){
var ui = SpreadsheetApp.getUi();
ui.alert(message);
}
@subtleGradient
subtleGradient / SheetMixinDemo.html
Last active September 6, 2018 19:37
Sheet Mixin Demo. Shows how to use spreadable mixins to do some wacky behavior sheets stuff with React
<!doctype html>
<meta charset=utf-8>
<title>HasSheetsMixin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.11.0/es6-shim.min.js"></script>
<script src="http://fb.me/react-with-addons-0.11.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.1.js"></script>
<div id="SheetsDemoRoot"></div>