Skip to content

Instantly share code, notes, and snippets.

View kingcc's full-sized avatar
🤤
C++ is lame, man. Let’s rock with Rust.

Nemo kingcc

🤤
C++ is lame, man. Let’s rock with Rust.
View GitHub Profile
@kingcc
kingcc / change_hand.sma
Last active November 11, 2023 03:47
This CS1.6 amxx plugin switches a player’s weapon hand via double-click on move buttons quickly.
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#define PLUGIN "Change Hand"
#define AUTHOR "kingcc"
#define VERSION "1.0"
#define CVAR_CHANGE_HAND_TOGGLE_INTERVAL "change_hand_toggle_interval"
@kingcc
kingcc / modify_date_of_commit.sh
Last active August 16, 2023 11:49
modify date & time of git commit to match its message
#!/bin/bash
# This script is designed to find the latest Git commit that contains a date,
# and then change its commit date to a specified date. To achieve this goal,
# the script performs the following operations:
#
# Use the git log command to find the SHA of the latest Git commit that contains
# a date.
# Extract the date string from the commit message of the identified commit.
# Convert the date string to a format that Git can accept using the date command
@kingcc
kingcc / leetString.js
Last active January 5, 2021 08:27
Replace a string with a `leet` style string
/**
* Replace a string with a `leet` style string
*/
function stringToNumber(str) {
const dir = {
o: 0,
O: 0,
i: 1,
I: 1,
l: 1,
@kingcc
kingcc / FillFormsByHotkey.js
Last active September 11, 2022 12:55
Fill Out Forms Quickly With Hotkey
/**
* Fill Out Forms Quickly With Hotkey
*
* Usage:
* 1. Modify `contentsByKey`;
* 2. Paste these lines into website's console ( Ctrl/Cmd + Shift + I );
* 3. Focus target element which you what to fill in page,
* then press hot key, content will be fill in.
*
* Author:
@kingcc
kingcc / readMutiLines
Last active March 23, 2017 05:30
nodeJS read muti-lines datas from console.
/**
* nodeJS read muti-lines datas from console.
* @Author kingcc
* @DateTime 2017-03-23T13:29:22+0800
* @param {Function} cb callback
* @return {[type]} callback results
*/
function readMutiLines(cb) {
let datas = [];
process.stdin.setEncoding('utf8');
@kingcc
kingcc / gulpfile.js
Last active August 29, 2015 14:22 — forked from luxiaojian/gulpfile.js
var gulp = require('gulp');
var wiredep = require('wiredep');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var $ = require('gulp-load-plugins')();
var config = {

sassPath: './resources/sass',

bowerDir: './bower_components'

}