This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Declare this near the top of your addon | |
local L = setmetatable({}, {__index=function(t,i) return i end}) | |
-- Then for english use the english statement in the usage, like this: | |
tooltip:SetText( L["Click here to see something"] ) | |
-- Later when you want to add a locale, change the declaration of L to include the new language in the base table | |
local L = setmetatable(GetLocale() == "koKR" and { | |
["Click here to see something"] = "something in korean", | |
} or {}, {__index=function(t,i) return i end}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The following will convert from itemloc to inventory slot or container bag,slot | |
local ITEM_INVENTORY_PLAYER = 0x00300000 | |
local ITEM_INVENTORY_BAGS = 0x00200000 | |
local MASK_BAG = 0xf00 | |
local MASK_SLOT = 0x3f | |
local bagMap = { | |
[0x000] = 0, | |
[0x100] = 1, | |
[0x200] = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: http://adventuresinswitching.blogspot.com/2008/04/convert-shn-shorten-to-mp3-or-flac-in.html | |
# convert all shn files in the current directory to wav | |
shntool conv -o wav *.shn | |
# convert all wav files in the current directory to mp3 | |
for file in *.wav; do $(lame -V2 "$file" "${file%.wav}.mp3"); done | |
# clean up the mess | |
rm *.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.flac; do flac -cd "$file" | lame -f –-preset extreme – "${file%.flac}.mp3"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RDP Tunneling via Putty and SSH | |
1. Putty to the external address using ssh (e.g. yourmachine.dyndns.org) | |
2. Figure out the IP address of the machine inside your network that you want to connect to | |
e.g. 192.168.1.110 | |
3. Open putty settings and add the following to the tunnels section | |
Source: 3333 | |
Destination:192.168.1.110:3389 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git functions | |
# Mark Embling (http://www.markembling.info/) | |
# Is the current directory a git repository/working copy? | |
function isCurrentDirectoryGitRepository { | |
if ((Test-Path ".git") -eq $TRUE) { | |
return $TRUE | |
} | |
# Test within parent dirs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
-- Lua solution to the Weasel Program | |
-- by Peter Provost <pprovost_at_gmail_dot_com> | |
-- See: http://en.wikipedia.org/wiki/Weasel_program | |
-- Alternate language solutions: http://rosettacode.org/wiki/Evolutionary_algorithm#Python | |
--]] | |
local target = "METHINKS IT IS LIKE A WEASEL" | |
local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " | |
local c, p = 100, 0.06 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls *.avi | % { | |
if( $_.Name -match "futurama-2(\d\d)-amc.avi") { | |
ren $_ Futurama.S02E$($Matches[1])-amc.avi | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Replace this function with your "new" function | |
local function NewItem() | |
return { } | |
end | |
-- Storage of released items | |
local pool = {} | |
-- Get/create a new item | |
local function Acquire() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop] | |
"ScreenSaverIsSecure"="0" |