Skip to content

Instantly share code, notes, and snippets.

View mmqmzk's full-sized avatar
:shipit:
Focusing

Kun Zhou mmqmzk

:shipit:
Focusing
View GitHub Profile
@mmqmzk
mmqmzk / bookmarklet.js
Last active February 12, 2023 10:20
My bookmarklets.
javascript:scrollTo(0,0); // Scroll to top
javascript:scrollTo(0,document.documentElement.scrollHeight) // Scroll to bottom
javascript:(function(){location=location.protocol+'//'+location.hostname})() // Site top
javascript:(function(){if(location.pathname=='/');else if(location.pathname.charAt(location.pathname.length-1)=='/')location='..';else location='.'})() // Up one level
javascript:(function(){setTimeout(()=>document.cookie.length<1?alert('No cookie for this site.'):open('').document.write(document.cookie),0)})(); // Show cookies
javascript:(function(){location='https://simp.red/trans?url='+decodeURIComponent(location.href)})(); // Simpread @broken
javascript:(function(){location='https://cn.similarsites.com/site/'+location.hostname.replace(/^(.+\.)?([^.]+\.[^.]+)$/,'$2')})(); // Similar sites
javascript:(function(){location='http://www.google.com/search?q=cache:'+decodeURIComponent(location.href)})(); // Google cached
javascript:(function(){location='https://web.archive.org/web/*/'+decodeURIComponent(
@mmqmzk
mmqmzk / gist.sh
Last active May 7, 2021 03:21
Bash script to maniplute gists.
#!/usr/bin/env bash
while [[ -n "$1" ]]; do
case "$1" in
-d | --desc | --description)
description="$2"
shift
;;
-i | --id | --gist)
gist="$2"
shift
@mmqmzk
mmqmzk / gist:6ef48e5581ea3f34d88ff8d00d5dcdd4
Last active August 10, 2020 10:05
Windows Terminal profile
We couldn’t find that file to show.
@mmqmzk
mmqmzk / ahk.vbs
Last active March 5, 2023 09:28
Hot window keys
Set oWS = WScript.CreateObject("WScript.Shell")
iReturn = oWS.Run("""%ProgramFiles%\AutoHotkey\AutoHotkey.exe"" ""%NUT_STORE%\Config\AHK\win.ahk""", 0, False)
@mmqmzk
mmqmzk / .ideavimrc
Last active February 5, 2023 08:52
set number "relativenumber
set scrolloff=4
set ignorecase smartcase
set incsearch
set hlsearch
set autoindent
set smartindent
set timeoutlen=750
set showmode
set showcmd
@mmqmzk
mmqmzk / config-file.cnf
Last active March 28, 2020 07:20
Mysql & MariaDB use utf8mb4 as default.
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_large_prefix = true
@mmqmzk
mmqmzk / javascript_resources.md
Created April 25, 2014 10:21 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mmqmzk
mmqmzk / 0_reuse_code.js
Created April 25, 2014 10:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console