This file contains hidden or 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
SELECT HASHBYTES('sha2_512', 'mypassword') | |
--algorithms: MD2 | MD4 | MD5 | SHA | SHA1 | SHA2_256 | SHA2_512 | |
declare @enc varbinary(256) | |
select @enc = EncryptByPassPhrase('key', 'mypassword' ) | |
--returns: 0x01000000D6191ADF19FF136F0A82E469E55AF781FC9D61904BA73039971C82FE88D3E758 | |
select Cast(DECRYPTBYPASSPHRASE('key', @enc) as varchar(4000)) | |
-- #sqlserver #tsql #encryption |
This file contains hidden or 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
Option Compare Database | |
Option Explicit | |
'Reference: http://khoiriyyah.blogspot.com/2012/06/vb6-hash-class-md5-sha-1-sha-256-sha.html | |
'The above article is excellent but that code works for 32-bit Access/Excel only. | |
'This works on both 32-bit and 64-bit Access/Excel. | |
'Requires no dll References in the VB Editor. It uses advapi32.dll, which needs no Reference | |
' as these are Windows API calls only. | |
'I have not seen documented anywhere else on the Internet how to make these calls in 64-bit apps. |
This file contains hidden or 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
------------------------------------------------------------------------ | |
-- Create a Comma Delimited List Using SELECT Clause From Table Column | |
-- from: http://tinyurl.com/7ac6yaj (blog.sqlauthority.com) | |
------------------------------------------------------------------------ | |
USE AdventureWorks | |
GO | |
DECLARE @listStr VARCHAR(MAX) | |
SELECT @listStr = COALESCE(@listStr+',' ,'') + Name | |
FROM dbo.Product | |
SELECT @listStr |
This file contains hidden or 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
# from topic "Changing E-Mail Addresses Globally in Pro-Git eBook (location 3892 of 9052) | |
git filter-branch --commit-filter ' | |
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; | |
then | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' HEAD |
This file contains hidden or 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
Option Explicit | |
Dim oFSO, oFolder, oSubFolder, oSubFolders, sDirectoryPath, sTempDir | |
Dim oFileCollection, oFile, sDir | |
Dim iDaysOld, iFiles, iFolders | |
Dim wshShell | |
'Get user Temp directory path from environment variable | |
Set wshShell = CreateObject( "WScript.Shell" ) | |
sTempDir = wshShell.ExpandEnvironmentStrings( "%TEMP%" ) | |
'An alternate is "%LOCALAPPDATA%\Temp" |
This file contains hidden or 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
<?php | |
function getUrls($string) { | |
//adapted from: https://stackoverflow.com/questions/11588542/get-all-urls-in-a-string-with-php | |
$regex = '/https?\:\/\/[^\" \n]+/i'; | |
preg_match_all($regex, $string, $matches); | |
//note below that we use $matches[0], this is because we have an array of arrays | |
foreach ($matches[0] as $url) { | |
$s1 = substr($url, 0, strlen($url)-2); | |
$s2 = '<a href="' . $s1 . '">' . $s1 . '</a>'; | |
echo "$s2<br />\n"; |
This file contains hidden or 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
Copy URL in Markdown format: | |
javascript:(function() {text='[' + document.title + '](' + location.href+')' + window.getSelection(); navigator.clipboard.writeText(text);tempAlert("<mark><b>URL COPIED TO CLIPBOARD</mark></b>", 2000); function tempAlert(msg, duration) {var el = document.createElement("div"); el.setAttribute("style","position:absolute;top:5%;left:20%;background-color:white;"); el.innerHTML = msg; document.body.appendChild(el); setTimeout(function(){el.parentNode.removeChild(el);}, duration);}})(); | |
Copy URL in HTML format: | |
javascript:(function() {text='<a href="'+location.href + '">' + document.title +'</a><br>' + window.getSelection(); navigator.clipboard.writeText(text);tempAlert("<mark><b>URL COPIED TO CLIPBOARD</mark></b>", 2000); function tempAlert(msg, duration) {var el = document.createElement("div"); el.setAttribute("style","position:absolute;top:5%;left:20%;background-color:white;"); el.innerHTML = msg; document.body.appendChild(el); setTimeout(function(){el.parentNode.removeChild(el |
OlderNewer