Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
// Find the latest version of this script here:
// https://gist.github.com/rsms/a8ad736ba3d448100577de2b88e826de
//
const EM = 2048
interface FontInfo {
familyName :string
styleName :string
unitsPerEm :int
ascender :int
@coughski
coughski / subway_widget.js
Created April 8, 2022 19:50
A NYC subway departure timeline widget with status alerts
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: subway;
let GtfsRealtimeBindings = importModule("gtfs-realtime.js") // add this file to Scriptable from https://github.com/MobilityData/gtfs-realtime-bindings/blob/master/nodejs/gtfs-realtime.js
// also add https://github.com/protobufjs/protobuf.js/blob/master/dist/protobuf.min.js to Scriptable
const API_KEY = "paste_your_api_key_here" // get a free MTA API key at https://api.mta.info/#/landing
const ROOT = "entity"
const ALERT = "alert"
@coughski
coughski / citi_bike.js
Last active January 20, 2024 06:24
Scriptable widget for tracking the status of a Citi Bike station
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: bicycle;
/*** WIDGET SETUP ***
* Edit the Scriptable widget, select this CitiBike script, and fill the Parameter field with your station's id
*
* HOW TO FIND A STATION'S ID
* Search for a CitiBike station by street name at https://gbfs.citibikenyc.com/gbfs/en/station_information.json
* Find the station_id field associated with the name
@simonbs
simonbs / GitHub Sponsors Widget.js
Created January 31, 2022 15:19
Shows the total number of GitHub sponsors and the latest sponsors in a widget using the Scriptable app
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: brown; icon-glyph: hand-holding-usd;
// To use this script, you must create a personal access token on GitHub with the `read:org// scope.
// Follow the instructions on the link below to create your personal access token.
//
// https://github.com/settings/tokens
//
// Run the script when you ahve created your personal access token. It'll prompt you to enter the token and store it securely in the keychain on the device.
@simonbs
simonbs / Unleashed.js
Created October 13, 2021 06:36
Scriptable widget that counts down to Apple's Unleashed event on October 18th
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: apple-alt;
const TITLE = ""
const DATE = "2021-10-18T17:00:00Z"
const BG_IMG_URL = "https://i.ibb.co/YQ09XTW/background.png"
const TITLE_IMG_URL = "https://i.ibb.co/qYH3Y9w/text.png"
const TITLE_IMG_SIZE = new Size(155, 25)
const LINK = "https://www.youtube.com/watch?v=exM1uajp--A"
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
import tensorflow as tf
model_name = 'bert-base-cased'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = TFAutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
texts = ["I'm a positive example!", "I'm a negative example!"]
labels = [1, 0]
@d3noob
d3noob / .block
Created June 19, 2021 03:43
Filtering in v7
license: mit
@stwind
stwind / slug_font.ipynb
Last active January 21, 2023 23:14
Generating Slug font, see https://observablehq.com/@stwind/slug-vector-fonts-rendering for WebGL2 rendering.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nanlliu
nanlliu / clevr_data_generation.ipynb
Created February 19, 2021 03:44
clevr_data_generation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JakeCoxon
JakeCoxon / distribute.py
Created December 24, 2020 21:32
Blender addon to distribute objects along an axis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.