Skip to content

Instantly share code, notes, and snippets.

View mrjjwright's full-sized avatar

John Wright mrjjwright

View GitHub Profile
Well, the way to think about it is that when we train a large neural network to accurately predict the next word in lots of different texts from the internet, what we are doing is that we are learning a world model. It looks like we are learning this. It may look on the surface that we are just learning statistical correlations in text, but it turns out that to just learn the statistical correlations in text, to compress them really well, what the neural network learns is some representation of the process that produced the text. This text is actually a projection of the world. There is a world out there, and it has a projection of this text. So, what the neural network is learning is more and more aspects of the world, of people, of the human conditions, their hopes, dreams, and motivations, their interactions in the situations that we are in. The neural network learns a compressed, abstract, usable representation of that. This is what is being learned from accurately predicting the next word. And furthermor
@mrjjwright
mrjjwright / styed_component.js
Created January 19, 2017 17:33
Simple Styled Component
const TeamSelectionContainer = styled.div`
height: 100%;
display: flex;
flex-direction: column;
color: white;
font-size: 25px;
`;
@mrjjwright
mrjjwright / mobservable-vidom.js
Last active January 12, 2016 22:20
Make vidom components reactive using mobservable
(function() {
function mrFactory(mobservable, vidom) {
if (!mobservable)
throw new Error("mobservable-vidom requires the Mobservable package.")
if (!vidom)
throw new Error("mobservable-vidom requires vidom to be available");
var isTracking = false;
// WeakMap<Node, Object>;
@mrjjwright
mrjjwright / AppDelegate.swift
Last active August 29, 2015 14:17
Few Component nesting
import Cocoa
import Few
private func render1(component: Few.Component<()>, state: ()) -> Element {
return View(backgroundColor: NSColor.redColor())
.direction(.Column)
.flex(1)
}
@mrjjwright
mrjjwright / Repository.coffee
Last active August 29, 2015 14:17
JSON git like repository idea
Immutable = require('immutable')
immutableDiff = require("immutablediff")
sha = require("stable-sha1")
class Repository
constructor: (initialData) ->
@workingCopy = Immutable.fromJS(initialData)
@objectMap = {}
@author = "mrjjwright@gmail.com"
@mrjjwright
mrjjwright / gist:3240020
Created August 2, 2012 19:41
Extract largest image thumbnail from url using node and cheerio
cheerio = require('cheerio')
Shred = require('shred')
shred = new Shred()
http = require('http')
URL = require('url')
server = http.createServer (request, response) ->
url = URL.parse(request.url, true)
urlToDiscover = url.query['url']
startDiscovery urlToDiscover, (theImageURL) ->
@mrjjwright
mrjjwright / gist:3029371
Created July 1, 2012 19:43
AppPlay - an app developer's logic tool
- AppPlay is an interactive logic tool for app developers. Your app
manages lots of related logic:
- States
- Events
- Simple Conditional logic
- Stories
- User Actions
- Screenshots of how things should look.
- This logic is independent of how you technically implement it and
should be maintained outside your code.
@mrjjwright
mrjjwright / ExampleAppDelegate.m
Created April 10, 2012 16:11
Modify TUIKit example to show textview inside of a scrollview
/* TUINSView is the bridge between the standard AppKit NSView-based heirarchy and the TUIView-based heirarchy */
TUINSView *tuiScrollViewContainer = [[TUINSView alloc] initWithFrame:b];
[scrollViewWindow setContentView:tuiScrollViewContainer];
scrollExample = [[TUIScrollView alloc] initWithFrame:b];
scrollExample.backgroundColor = [TUIColor redColor];
TUITextView *textView = [[TUITextView alloc] initWithFrame:scrollExample.bounds];
textView.text = @"hellodfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddfdfddf
@mrjjwright
mrjjwright / TUILayout.h
Created December 4, 2011 15:47
TUILayout
//
// TUILayout.h
// Crew
//
// Created by John Wright on 11/13/11.
// Copyright (c) 2011 AirHeart. All rights reserved.
//
#define kTUILayoutViewHeight @"kTUILayoutViewHeight"
@mrjjwright
mrjjwright / hyperlinkString.m
Created August 24, 2011 15:03
TUIAttributedString as hyperlink
+(id)hyperlinkFromString:(NSString*)inString withURL:(NSURL*)aURL
{
TUIAttributedString* attrString = [TUIAttributedString stringWithString:inString];
NSRange range = NSMakeRange(0, [attrString length]);
[attrString beginEditing];
[attrString addAttribute:NSLinkAttributeName value:[aURL absoluteString] range:range];
// make the text appear in blue
NSColor *blueColor = [TUIColor colorWithHexString:@"#3B5998"].nsColor;