Skip to content

Instantly share code, notes, and snippets.

View 17's full-sized avatar
🦖

Jase Su 17

🦖
  • Oracle
  • Canton, China
View GitHub Profile
@17
17 / init.bat
Last active August 23, 2022 03:36
Cmder explorer context menu integration
@echo off
SET CMDER_ROOT=%~dp0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\Cmder" /ve /d "Cmder Here" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\Cmder" /v "Icon" /d "\"%CMDER_ROOT%cmder.exe\"" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\Cmder" /v "Extended" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\Cmder\command" /ve /d "\"%CMDER_ROOT%cmder.exe\" \"%%V\"" /f
pause
@17
17 / example.bat
Last active August 29, 2015 13:55
hrun.vbs is a command utility, that allows you to run multiple apps and commands without any window in the background.
@echo off
cscript hrun.vbs "cmd /c ipconfig /all >result.txt" >nul
pause
@17
17 / srvmgr.bat
Last active December 22, 2022 06:39
installing and removing a user-defined service.
@echo off
setlocal
set ServicePath=HKLM\System\CurrentControlSet\Services
if "%1"=="-i" goto :create
if "%1"=="-d" goto :delete
goto :usage
:create
var cat = function (hands, feet) {
this.hands = hands
this.feet = feet
},
fatcat = function (hands, feet, kg) {
this.kg = kg
console.log(this)
cat.call(this, hands, feet)
<?php
function ResetJquery() {
wp_deregister_script('jquery');
wp_register_script('jquery', '//code.jquery.com/jquery-1.11.1.min.js', false, '1.11.1');
}
add_action('init', 'ResetJquery');
@17
17 / bilibili.js
Created November 17, 2014 13:45
bilibili miner!
var miner = function() {
var postData, timeoutID, startLoop, stopLoop, printList
var list = []
startLoop = function(delay) {
console.log('开始了辛勤的挖掘.')
timeoutID = setInterval(postData, delay || 1000 * 10)
}
stopLoop = function() {
<?php
add_filter( 'init', 'guest_page');
function guest_page() {
if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
$_post = get_queried_object();
$_post_ID = $_post->ID;
@17
17 / gist:afaa1e1ca27c043b6d41
Last active August 29, 2015 14:20
JQuery offsetX fix
var mousePosition = function(e) {
var offsetX = e.offsetX
, offsetY = e.offsetY
, targetOffset
// Calculate offsetX/Y if missing
if (offsetX == null) {
targetOffset = $(e.target).offset()
offsetX = e.pageX - targetOffset.left
@17
17 / test.js
Created December 26, 2015 08:19
sql.js vs node-sqlite
var fs = require('fs')
var sqljs = require('sql.js')
var sqlite3 = require('sqlite3').verbose()
var count = 1e5
function randomString() {
var str = ''
var chars = 'abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY0123456789 '
for (var i = Math.random() * 100; i > 0; i--) {
str += chars[Math.floor(Math.random() * chars.length)]
@17
17 / generate-crc32b-uid.py
Created July 9, 2016 19:55
Generate CRC32B UID Rainbow Tables
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
try:
xrange
except NameError:
xrange = range