type | type_desc |
---|---|
AF | Aggregate function (CLR) |
C | CHECK constraint |
D | Default or DEFAULT constraint |
F | FOREIGN KEY constraint |
FN | Scalar function |
FS | Assembly (CLR) scalar-function |
FT | Assembly (CLR) table-valued function |
IF | In-lined table-function |
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 DISTINCT | |
type AS object_type, | |
type_desc AS object_type_desc, | |
SCHEMA_NAME(schema_id) AS schema_name, | |
name AS object_name, | |
OBJECT_DEFINITION(object_id) AS object_source | |
FROM sys.objects | |
WHERE OBJECT_DEFINITION(object_id) LIKE '%search_string%' | |
AND ( | |
type_desc LIKE '%VIEW%' |
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] | |