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
#!/bin/bash | |
sudo mount --verbose -t cifs -o username=USERNAME,domain=DOMAIN,password=PASSWORD,uid=$USER,vers=2.0 //IP_ADDRESS/D$ /mnt/DIR_TO_MOUNT | |
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
$xml = new DOMDocument(); | |
$xml->preserveWhiteSpace = false; | |
$xml->formatOutput = true; | |
$xml->load('file.xml'); | |
$xpath = new DOMXPath($xml); | |
// Search in node ITEMS wich contains the keyword KEYWORD | |
$items = $xpath->query('//item[contains(.,"KEYWORD")]'); | |
for ($i = $items->length - 1; $i >= 0; $i--) { |
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
# List branchs | |
git branch -r | awk -F/ '/\/PREFIX/{print $2}' | |
# Delete from local | |
git branch -D `git branch -r | awk -F/ '/\/PREFIX/{print $2}'` | |
# Delete from remote | |
git branch -r | awk -F/ '/\/PREFIX/{print $2}' | xargs git push origin --delete |
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 @NextDayID INT = 4 -- 0=Mon, 1=Tue, 2 = Wed, ..., 5=Sat, 6=Sun | |
SELECT DATEADD(DAY, (DATEDIFF(DAY, @NextDayID, GETDATE()) / 7) * 7 + 7, @NextDayID) AS NextDay | |
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
Show hidden characters
{ | |
"GET & SET for ASP Models": { | |
"scope": "asp, vb, vbs", | |
"prefix": "getset", | |
"body": [ | |
"\t' GET & SET for attribute {$1}", | |
"\t' ", | |
"\t' @return {$1}", | |
"\tPublic Property Get $1()", | |
"\t\t$1 = m_$1", |
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
# Create if not exists | |
sudo mkdir -p /mnt/newFolder | |
# Mount in | |
sudo mount //<server_address>/<folder> -t cifs -o uid=1000,gid=1000,username=<username>,password=<password> /mnt/newFolder/ |
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 *.oldExtension; do | |
mv "$file" "$(basename "$file" .oldExtension).newExtension" | |
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
DECLARE | |
@variable1 INT, | |
@variable2 INT | |
-- Create a new cursor | |
DECLARE cursor_example CURSOR FOR | |
SELECT field1, field2 FROM [table] | |
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
Function GetRSArray(strSQL) | |
Set objRS = Conn.Execute(strSQL) | |
If Not objRS.EOF Then arrRS = objRS.GetRows() | |
Set objRS = Nothing | |
GetRSArray = arrRS | |
End Function | |
arrRS = GetRSArray("SELECT ID, Name FROM users;") | |
If IsArray(arrRS) Then |
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
SELECT A.COLUMN_NAME | |
FROM INFORMATION_SCHEMA.COLUMNS A | |
JOIN INFORMATION_SCHEMA.COLUMNS B ON A.COLUMN_NAME = B.COLUMN_NAME | |
WHERE A.TABLE_NAME = 'table_a' | |
AND B.TABLE_NAME = 'table_b' |