This Gist was automatically created by Carbide, a free online programming environment.
Last active
March 9, 2024 13:34
-
-
Save bijection/b1542b3b90cc0b80a56f8393afa46821 to your computer and use it in GitHub Desktop.
Widget Menagerie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///SelectorWidget | |
var x = ['horse', 'staple', 'amnesia'] | |
x[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///SliderWidget | |
var f = 45, | |
c = (f - 32) / 1.8 | |
f - c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// GridArrayWidget | |
[ | |
{"sepalLength": 5.1, "sepalWidth": 3.5, "petalLength": 1.4, "petalWidth": 0.2, "species": "setosa"}, | |
{"sepalLength": 5.0, "sepalWidth": 3.3, "petalLength": 1.4, "petalWidth": 0.2, "species": "setosa"}, | |
{"sepalLength": 6.2, "sepalWidth": 2.9, "petalLength": 4.3, "petalWidth": 1.3, "species": "versicolor"}, | |
{"sepalLength": 5.1, "sepalWidth": 2.5, "petalLength": 3.0, "petalWidth": 1.1, "species": "versicolor"}, | |
{"sepalLength": 5.7, "sepalWidth": 2.8, "petalLength": 4.1, "petalWidth": 1.3, "species": "versicolor"}, | |
{"sepalLength": 6.3, "sepalWidth": 3.3, "petalLength": 6.0, "petalWidth": 2.5, "species": "virginica"}, | |
{"sepalLength": 6.2, "sepalWidth": 3.4, "petalLength": 5.4, "petalWidth": 2.3, "species": "virginica"}, | |
{"sepalLength": 5.9, "sepalWidth": 3.0, "petalLength": 5.1, "petalWidth": 1.8, "species": "virginica"} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// FormObjectWidget | |
var x = {"sepalLength": 5.9, "sepalWidth": 3.0, "petalLength": 5.1, "petalWidth": 1.8, "species": "virginica"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ObjectInspector | |
var object = {Hello: 'doge', what: ['is', 'up']} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// JSONDiffWidget | |
import _ from 'lodash' | |
_.isEqual({Hello: "doge", what: ['is', 'up']}, | |
{hello: 'hal', what: ['is', 'love']}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// StringDiffWidget | |
"StringDiffWidget" === "stringbean" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// SimpleMapWidget | |
var places = [{"lat":42.293564192170095,"lon":-69.9609375},{"lat":25.48295117535531,"lon":-44.29687499999999},{"lat":10,"lon":-69},{"lat":42,"lon":-90},{"lat":12,"lon":-1}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// SinglePointMapWidget | |
var MIT = {lat: 42.3601, lon:-71.0942} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// JSONWidget | |
var record = {"record":{"probably":{"conforms":["to","some","special","schema"]}}} | |
record.record.probably.conforms[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Chart1DWidget | |
var points = [] | |
for(var i = -50; i < 50; i++){ | |
points.push(Math.sin(i/25)) | |
} | |
points |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///ColorPickerWidget | |
"red" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///TextWidget | |
var x = "dlroW olleh" | |
x.split('').reverse().join('').toUpperCase() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///MatrixWidget | |
[[1,2,3], [4,5,6]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// BufferWidget | |
var res = await fetch('https://i.imgur.com/S2AinSB.jpg') | |
var arrBuf = await res.arrayBuffer() | |
new Buffer(arrBuf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// HTMLElementWidget | |
var img = document.createElement('img') | |
img.style.width ='100%' | |
img.src = 'https://i.imgur.com/S2AinSB.jpg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ReactRenderWidget | |
import React from 'react' | |
import Spinner from 'react-spinner'; | |
<div style={{padding: 200}}> | |
<Spinner/> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// RandExpWidget | |
/([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// DateTimeWidget | |
new Date("2016-08-10T10:08:50.200Z") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment