Skip to content

Instantly share code, notes, and snippets.

@WingDust
WingDust / Random-string
Created August 24, 2022 09:38 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@WingDust
WingDust / removehtml
Created August 19, 2022 07:25 — forked from digitalex/removehtml
Delete all HTML comments in VIM
%s/<!--\_.\{-}-->//g
@WingDust
WingDust / vim-multiline-comment.md
Created August 19, 2022 07:24 — forked from ultim8k/vim-multiline-comment.md
(un) comment multiple lines vim

From: http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

For those tasks I use most of the time block selection.

Put your cursor on the first # character, press Ctrl``V (or Ctrl``Q for gVim), and go down until the last commented line and press x, that will delete all the # characters vertically.

For commenting a block of text is almost the same: First, go to the first line you want to comment, press Ctrl``V, and select until the last line. Second, press Shift``I``#``Esc (then give it a second), and it will insert a # character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/# in the second step instead.

@WingDust
WingDust / init.lua
Created July 30, 2022 23:37 — forked from handcoding/init.lua
Hammerspoon lua file to remap Excel’s keyboard shortcuts to make them more Mac like
local UP = hs.keycodes.map['up']
local DOWN = hs.keycodes.map['down']
local LEFT = hs.keycodes.map['left']
local RIGHT = hs.keycodes.map['right']
local RETURN = hs.keycodes.map['return']
function hasCmd(event)
local flags = event:getFlags()
return flags.cmd and not (flags.alt or flags.ctrl or flags.shift)
end
@WingDust
WingDust / Set-WindowState.ps1
Created June 4, 2022 05:51 — forked from lalibi/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
<#
.LINK
https://gist.github.com/Nora-Ballard/11240204
#>
[CmdletBinding(DefaultParameterSetName = 'InputObject')]
param(
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
[Object[]] $InputObject,
@WingDust
WingDust / technet-convert_alphanumeric_string_to_the_NATO.ps1
Created May 14, 2022 12:25 — forked from tommymaynard/technet-convert_alphanumeric_string_to_the_NATO.ps1
Convert Alphanumeric String to the NATO Phonetic Alphabet Equivalent
<#
TechNet Contribution: Convert Alphanumeric String to the NATO Phonetic Alphabet Equivalent
Previous link: https://gallery.technet.microsoft.com/Convert-Alphanumeric-8c1d6a79
Downloaded: 858 times (as of 05/21/2020)
There was a post in the TechNet Forum about needing a solution to convert a string into the NATO phonetic alphabet
equivalent (link). I really liked the project and quickly wrote out an advanced function in Windows PowerShell to
accompany the VBS solution that was also posted. Please let me know if there are any problems that need correcting.
The 1.3 version will speak the results, if the -Speak switch parameter is included when the function is run.
我本想享受生活,结果发现活下来都很困难。
你的计划,就像零食,吃到肚子里之后就是个屁。
我已经不是那个花五十块钱,也要考虑很久的小孩了,现在五块钱都要深思熟虑。
今天天气很好,在房间里宅久了,准备去客厅散散心。
春节你要小心了,毕竟过年,都是要杀猪的。
经过多年的打拼,虽然没有什么收获,但你有债呀!
人为什么叫人类,因为人活着就是累。
说错话不要紧,你还会继续说错的。
你倒下了,能顶替你的人千千万
你获得了很多金钱,但同时也失去了很多东西,比如烦恼。
@WingDust
WingDust / vocabulary.md
Created March 11, 2022 01:48 — forked from machikoyasuda/vocabulary.md
Japanese/English programming/tech vocabulary

----- Tech -----

拡張現実【かくちょうげんじつ】 augmented reality, AR

投資家【とうしか】 investor

静的【せいてき】 static