Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacopo Colò jacopocolo

View GitHub Profile
@jacopocolo
jacopocolo / arena-random-image-widget.js
Last active Nov 20, 2020
Scriptable widget that load a random image from an are.na channel
View arena-random-image-widget.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: black; icon-glyph: user-md;
// just replace the url below with the url if the channel you want to use
// image channels only, doesnt supoort text or anything else
const channel = 'https://www.are.na/una/color-tx32pz_qsu0'
const url = 'https://api.are.na/v2/channels/'+channel.substring(channel.lastIndexOf('/') + 1)+'/contents';
const req = new Request(url)
View THREE.MeshLine.js
import * as THREE from "https://threejs.org/build/three.module.js";
function MeshLine() {
this.positions = [];
this.previous = [];
this.next = [];
this.side = [];
this.width = [];
@jacopocolo
jacopocolo / guide.md
Last active Dec 17, 2020
Making a Bitsy game compatible with the Nintendo 3ds browser
View guide.md

The Nintendo 3ds browser is capable of running Bitsy games! And it's a delightful Bitsy machine.

To make games compatible, we just need to teach the 3ds browser to speak the language Bitsy is written in: modern Javascript!

To do that we need two things:

  1. The html page that contains your game
  2. A <script> </script> html element we'll add at the top of the page that translates modern Javascript to somewhat Javascript.

The whole script element is here. Just select the whole thing and copy.

@jacopocolo
jacopocolo / script.html
Created Apr 25, 2020
Polyfill functions to make Bitsy 7.0 and below work on a Nintendo 3ds browser
View script.html
<script type="text/javascript">
//assign polyfill
if (!Object.assign) {
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: function(target, firstSource) {
'use strict';
if (target === undefined || target === null) {
View tquery-bundle.js
This file has been truncated, but you can view the full file.
// tquery.js - https://github.com/jeromeetienne/tquery - MIT License
// vim: ts=4 sts=4 sw=4 expandtab
// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
// -- kossnocorp Sasha Koss XXX TODO License or CLA
@jacopocolo
jacopocolo / are.na-fullscreen-block-editor.css
Created Apr 14, 2019
Are.na full screen block editor CSS hack
View are.na-fullscreen-block-editor.css
.BlockLightboxMetadataPane__Dialog-zcu36p-0 {
max-width: none !important;
max-height: none !important;
width: 100% !important;
height: 100% !important;
}
.dznTKy > label:first-child {
flex-basis: 5% !important;
}
View printSwatches.js
// let's get a hold on the Sketch API
const sketch = require('sketch');
//let's expose these globally
var document = sketch.fromNative(context.document);
var page = document.selectedPage;
var Rectangle = require('sketch/dom').Rectangle;
var Shape = require('sketch/dom').Shape;
var Style = require('sketch/dom').Style;
var Group = require('sketch/dom').Group;
@jacopocolo
jacopocolo / Webview screensavers url
Created Nov 8, 2018
A couple of cool urls you can set as screensaver
View Webview screensavers url
Earth from space
https://www.youtube.com/embed/Xjs6fnpPWy4?&autoplay=1&controls=0&iv_load_policy=3&t=1m&mute=1
Sea
https://www.youtube.com/embed/SxWKffqBjMM?&autoplay=1&controls=0&iv_load_policy=3
View Simple-fetch.jsx
import * as React from "react";
import Avatar from "@collab-ui/react/lib/Avatar";
import "@collab-ui/core/css/collab-ui.min.css";
import "@collab-ui/icons/css/collab-ui-icons.css";
import { PropertyControls, ControlType, Data } from "framer";
const style: React.CSSProperties = {
margin: "0 0 20px 20px",
objectFit: "cover"
};
@jacopocolo
jacopocolo / guide.md
Last active Sep 24, 2018
How to add collab-ui react to Framer X
View guide.md

Quick guide on how to get started with Framer X and the collab-ui components

This guide assumes that you have yarn and a code editor installed on your computer (Visual Studio Code is the recommended one for Framer X, use that). If you don't, get installing:

One you are done:

  1. Create a new project in Framer X

  2. Save it