Skip to content

Instantly share code, notes, and snippets.

View latel's full-sized avatar
😉
I may be slow to respond.

LaTale latel

😉
I may be slow to respond.
View GitHub Profile
@eyedean
eyedean / vue-router-augmented-push.ts
Last active September 13, 2023 10:01
Augment Router.push of Vue-Router to suppress the "Uncaught (in promise) Error: Redirected when going from..." errors.
// Based on the following solution
// https://github.com/vuejs/vue-router/issues/2881#issuecomment-520554378
// Read my detailed notes at: https://stackoverflow.com/a/65326844
import Router, { RawLocation, Route } from "vue-router";
// Personal utils. Can be replaced with `Function` and `(e: Error) => any;` respectively.
export type AnyFunction<RETURN_T = any> = (...args: any[]) => RETURN_T;
export type ErrorHandlerFunction<RETURN_T = any> = (e: Error) => RETURN_T;
@kemist
kemist / Countdown to Midnight.js
Created June 23, 2019 09:52
Demonstration of how to use web view in Scriptable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: clock;
// This example shows how to load HTML into a web view. You can also load both CSS styling and JavaScript into the web view.
// Web views can be displayed in a Siri Shortcut.
// Note that this example uses the loadHTML() function of the WebView bridge. However, typically you would store your HTML and assets in the Scriptable folder in iCloud Drive and edit your HTML files using a suitable app, eg. Textastic. Then you can use the loadFile() function on the web view to load the HTML file.
let html = `
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<style>
body {
@Ryanb58
Ryanb58 / install.md
Last active April 6, 2025 11:47
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
获取小米智能设备token
@nolanlawson
nolanlawson / wishlist.md
Last active May 3, 2021 11:51
Safari IndexedDB/WebSQL bug wishlist

Safari IndexedDB/WebSQL bug wishlist

Big overview of what's missing in Safari 7.1+ and iOS 8+ in terms of browser storage.

Updated May 25th 2016

Safari (general)

@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@zhchbin
zhchbin / index.html
Created February 10, 2013 10:55
Node-Webkit API Demo: Window.capturePage
<html>
<body style="background: #333">
<script >
var gui = require('nw.gui');
var win = gui.Window.get();
function takeSnapshot() {
win.capturePage(function(img) {
var popWindow = gui.Window.open('popup.html',
{width: 420, height: 300});
popWindow.on('loaded', function() {