Skip to content

Instantly share code, notes, and snippets.

View mondaychen's full-sized avatar

Mengdi Chen mondaychen

View GitHub Profile
@mondaychen
mondaychen / gist:1598350
Created January 12, 2012 03:17 — forked from getify/gist:670840
using LABjs to load from a CDN, with simple error detection (& timeout), and a local load fallback
function loadOrFallback(scripts,idx) {
var successfully_loaded = false;
function testAndFallback() {
clearTimeout(fallback_timeout);
if (successfully_loaded) return; // already loaded successfully, so just bail
try {
scripts.tester();
successfully_loaded = true; // won't execute if the previous "test" fails
scripts.success();
// console.log("success: " + scripts.src[idx]);
@mondaychen
mondaychen / K10.js
Last active November 16, 2020 14:40 — forked from rsalzer/RandomWikimediaPicture.js
Scriptable-Script to open zoom link for my daughter
function runScriptable() {
const [title, link] = getZoomInfo(new Date());
const widget = createWidget(title, null, link);
if (config.runsInWidget) {
Script.setWidget(widget);
Script.complete();
} else {
widget.presentSmall();
}
@mondaychen
mondaychen / .vimrc
Last active April 24, 2023 04:16 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on