Skip to content

Instantly share code, notes, and snippets.

@steelywing
steelywing / WinImage-KeyGen.html
Last active March 10, 2024 12:14
winimage 9.0 keygen
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>WinImage 9.0 KeyGen</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style="text-align: center;">
<h1>WinImage 9.0 KeyGen</h1>
@steelywing
steelywing / google-translate-tooltip.user.js
Last active October 22, 2023 16:18
google translate tooltip for firefox & chrome
// ==UserScript==
// @name Google Translate Tooltip
// @namespace steely.wing
// @version 1.10
// @description Translates selected text into a tooltip.
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/)
// @include *
// @require http://code.jquery.com/jquery-2.1.0.min.js
// @grant GM_getValue
@steelywing
steelywing / ldap_escape.php
Last active September 4, 2023 08:07
ldap_escape() for PHP < 5.6
// Source: https://stackoverflow.com/a/8561604/1877620
if (!function_exists('ldap_escape')) {
define('LDAP_ESCAPE_FILTER', 0x01);
define('LDAP_ESCAPE_DN', 0x02);
/**
* @param string $subject The subject string
* @param string $ignore Set of characters to leave untouched
* @param int $flags Any combination of LDAP_ESCAPE_* flags to indicate the
@steelywing
steelywing / SerializableDictionary.cs
Last active May 21, 2023 07:18
C# SerializableDictionary
using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
/// <summary>
/// Base on https://weblogs.asp.net/pwelter34/444961
/// </summary>
/// <typeparam name="TKey"></typeparam>
@steelywing
steelywing / EnableSSH.js
Created January 31, 2021 05:51
Enable RedMi 2100 SSH access
// Work for RedMi 2100 firmware 2.0.23
// http://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rm2100/miwifi_rm2100_all_fb720_2.0.23.bin
function getSTOK() {
let match = location.href.match(/;stok=(.*?)\//);
if (!match) {
return null;
}
return match[1];
}
@steelywing
steelywing / format_number.js
Last active October 28, 2020 04:50
JavaScript format number
/**
* Format number
*
* (1234567.8).format(2)
* => "1,234,567.80"
*
* precision: decimal precision
*/
// Method 0 (http://stackoverflow.com/a/14428340/1877620)
@steelywing
steelywing / couns.md
Last active October 13, 2020 07:13
Couns Door Setup

Default Mode

  • Access door
    • Input password (Default 1234)
    • Press #
  • Enter programming mode
    • Press *
    • Input admin password (Default 9999)
    • Press #
  • Exit programming mode and Save
    • Press * in 1 minute
@steelywing
steelywing / jquery.plugin.js
Last active March 11, 2020 19:57
jQuery plugin boilerplate
/*
* Project:
* Description:
* Author:
* License:
*/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ($, window, document, undefined) {
@steelywing
steelywing / service.py
Created August 6, 2014 01:40
python windows service
import win32serviceutil
import win32service
import win32event
import servicemanager
# import signal
# import os
from multiprocessing import Process
from main import app