Skip to content

Instantly share code, notes, and snippets.

View npaton's full-sized avatar

Nicolas Paton npaton

View GitHub Profile
@npaton
npaton / chat.js
Created February 28, 2024 00:14
Empirica 2 Javascript chat
import React, {
useEffect,
useRef,
useState,
} from "react";
import { usePlayer } from "@empirica/core/player/classic/react";
import { Loading } from "@empirica/core/player/react";
export function Chat({
scope,

Keybase proof

I hereby claim:

  • I am npaton on github.
  • I am npaton (https://keybase.io/npaton) on keybase.
  • I have a public key ASALP_h7KvrujDH4E4wpcVL6kbe4CK9h8zbSMeBTCoI4EQo

To claim this, I am signing this object:

@npaton
npaton / myview.js
Created June 15, 2015 14:15
Resize image in browser (in the context of Meteor / Slingshot but applies to any in-browser resizing)
// <canvas id="resizeCanvas" width="10000" height="10000" style="display:none"></canvas>
Template.myview.events({
"change .image-select": function(e, t) {
// Verify it's an image...
console.time("total");
var img = document.createElement("img");
img.src = window.URL.createObjectURL(e.currentTarget.files[0]);
img.onload = function () {
import <Foundation/CPObject.j>
import "GoogleMapsView.j"
import "GoogleMapsControllerView.j"
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification