Skip to content

Instantly share code, notes, and snippets.

View jemgold's full-sized avatar
👽
vibing

Jem jemgold

👽
vibing
View GitHub Profile
// Either of the following two patterns can be used to immediately invoke
// a function expression, utilizing the function's execution context to
// create "privacy."
(function(){ /* code */ }()); // Crockford recommends this one
(function(){ /* code */ })(); // But this one works just as well
// Because the point of the parens or coercing operators is to disambiguate
// between function expressions and function declarations, they can be
@jemgold
jemgold / machine.js
Created November 15, 2019 19:34
Generated by XState Viz: https://xstate.js.org/viz
const cameraMachine = new Machine({
id: 'camera',
initial: 'requestPermissions',
context: {
camera: null,
videoUri: null,
},
states: {
requestPermissions: {
initial: 'pending',
@jemgold
jemgold / machine.js
Created November 15, 2019 19:32
Generated by XState Viz: https://xstate.js.org/viz
const videoUri = 'foo';
const createReviewMachine = new Machine({
id: 'review',
type: 'parallel',
context: {
video: null,
videoUri,
duration: 0,

https://www.youtube.com/watch?v=0zp-yKeFRTE

Now I consider that I myself I’m a successful man in business. I hate business. I hate everything to do with it; accounting, figuring, adding up numbers, because they’re all arid. They don’t smell of anything – sometimes there’s an interesting smell to the ink on a checkbook – but by and large all this figuring is a completely colourless occupation. I don’t like it, so I have to hand it over to accountants and lawyers and the people who seem to like it. But I don’t know whether they really do?

The essential principle of business of occupation in the world is this: figure out some way in which you get paid for playing.

When I was quite young – I forget the exact age – I made a solemn vow which was that I would never accept a job, I would always be my own employer. And curiously, there are very few roles in life which provide this possibility: the successful artist, writer and sometimes musician, sometimes the independent consultant, can occupy this role – I mean h

Framer for PC & Linux users

One of the most common questions I see in the Framer Facebook group is people wondering whether you need to use a Mac to run Framer. That’s understandable — the website has a screenshot of a Mac app, a download button, and a caption saying ‘available for Mac’. Here’s the thing — you can use Framer and join this wonderful community & way of working on any platform. Let me explain…

The app you see in the screenshots on the Framer website is ‘Framer Studio’. It’s a paid app, for OSX only. The thing that powers it though—Framer.js—is open source, and available for free on GitHub.

To save you having to compile the source, Framer provide a simple .zip file to get you started - including all of the JavaScript you need, and an HTML file to open in your browser. It’s that simple to get started with Framer on Windows or Linux!

So what’s Framer Studio? Where’s tha

@jemgold
jemgold / classWithIvar.cocoascript.js
Last active March 21, 2017 05:04 — forked from darknoon/classWithIvar.cocoascript.js
You can use ivars so you don't need to make so many hilarious classes
class Class {
constructor(ivars = []) {
const uniqueClassName = "fetchDelegate_" + NSUUID.UUID().UUIDString();
const cls = MOClassDescription.allocateDescriptionForClassWithName_superclass_(uniqueClassName, NSObject);
const prototype = Object.getPrototypeOf(this);
Object.getOwnPropertyNames(prototype).forEach(prop => {
console.log(prop);
const sel = NSSelectorFromString(prop);
cls.addInstanceMethodWithSelector_function_(sel, prototype[prop]);
@jemgold
jemgold / classWithIvar.cocoascript.js
Created March 21, 2017 04:59 — forked from darknoon/classWithIvar.cocoascript.js
You can use ivars so you don't need to make so many hilarious classes
// Make a class with some handlers.
function Class(handlers){
var uniqueClassName = "fetchDelegate_" + NSUUID.UUID().UUIDString();
var cls = MOClassDescription.allocateDescriptionForClassWithName_superclass_(uniqueClassName, NSObject);
// Add each handler to the class description
for(var selectorString in handlers) {
var sel = NSSelectorFromString(selectorString);
cls.addInstanceMethodWithSelector_function_(sel, handlers[selectorString]);
}
// Add ivar to store instance-specific info
@jemgold
jemgold / ShareButton.jsx
Created May 17, 2016 16:54 — forked from jamesslock/ShareButton.jsx
ReactJS Share Buttons
import React, { PropTypes } from 'react';
import Button from '../components/Button.jsx';
import Icon from '../components/Icon.jsx';
module.exports = React.createClass({
render: function () {
const {
className,
classNameIcon,
children,
### Keybase proof
I hereby claim:
* I am jongold on github.
* I am gold (https://keybase.io/gold) on keybase.
* I have a public key ASDVO2aXukJHlPFfrT2O_-GRHfwLPHVeRqhj7UGLswrsFgo
To claim this, I am signing this object:
@jemgold
jemgold / app.coffee
Created July 30, 2014 12:32
class-based Framer prototypes
# An example with classes building components.
# This stuff is a little fiddly to get set up,
# but once it's working it's great - you can just
# add new instances of the components, and each
# components holds references to all of its
# children. You can set defaults & states for each
# component separately.
#
# (try clicking on the post author, and then on each
# of the comments on a post)