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 | |
CASE | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '8.00.%' THEN 'Microsoft SQL Server 2000' | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '9.00.%' THEN 'Microsoft SQL Server 2005' | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '10.00.%' THEN 'Microsoft SQL Server 2008' | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '10.50.%' THEN 'Microsoft SQL Server 2008 R2' | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '11.0%' THEN 'Microsoft SQL Server 2012' | |
WHEN CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(20)) LIKE '12.0%' THEN 'Microsoft SQL Server 2014' | |
END Product, | |
SERVERPROPERTY('ProductVersion') [Product Version], |
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
-- Find Collation of SQL Server Database | |
SELECT DATABASEPROPERTYEX('<database-name>', 'Collation') | |
-- list column collations | |
SELECT o.name, C.name, collation_name | |
FROM sys.columns C | |
INNER JOIN sys.objects O | |
ON O.object_id = c.object_id | |
WHERE O.type = 'U' | |
AND collation_name IS NOT NULL |
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
ffmpeg -i "in.m4a" -ab 96k "out.mp3" |
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
tag 'date' do |tag| | |
page = tag.locals.page | |
format = (tag.attr['format'] || '%A, %B %d, %Y') | |
time_attr = tag.attr['for'] | |
date = if time_attr | |
case | |
when time_attr == 'now' | |
Time.zone.now | |
when Page.date_column_names.include?(time_attr) | |
page[time_attr] |
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
Paste in SO chat room console bro: | |
(function() { | |
"use strict"; | |
var chat = document.getElementById('chat'); | |
function parseNode(node) { | |
if (node.classList | |
&& node.classList.contains('message') | |
&& !node.classList.contains('pending') | |
&& !node.querySelector('.onebox') |
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
/* | |
on os x compile with | |
clang++ scope_operator.cpp -o scope_operator | |
on windows compile with | |
cl /EHsc scope_operator.cpp | |
on linux compile with | |
g++ scope_operator.cpp -o scope | |
*/ |
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
/* | |
on os x compile with | |
clang++ structure_pointers.cpp -o structure_pointers | |
on windows compile with | |
cl /EHsc structure_pointers.cpp | |
on linux compile with | |
g++ structure_pointers.cpp -o structure_pointers | |
*/ |
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
/* | |
on os x compile with (install xcode and command line tools) | |
clang++ pointers.cpp -o pointers | |
on windows compile with (install visual studio) | |
cl /EHsc pointers.cpp | |
on linux compile with (apt-get install g++) | |
g++ pointers.cpp -o pointers | |
*/ |
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 @myDoc xml | |
SET @myDoc = '<?Processing Instructions for=EXE.exe ?> | |
<root> | |
<!-- instructions for the 1st work center --> | |
<country LocationID="10" | |
GDP="1.1" | |
GNI=".2" >Some text 1 | |
<city id="1">London</city> | |
<city>Manchester</city> | |
<city id="3">Liverpool</city> |
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 schema_name(o.schema_id) as [Schema_Name] | |
, o.name as [object_name] | |
, u.name as [principal_name] | |
, u.type_desc as [principal_type] | |
, r.minor_id, r.permission_name, r.state_desc | |
, o.schema_id, o.principal_id as [alt_owner], o.type_desc | |
from sys.database_permissions r | |
Left Join sys.database_Principals u | |
ON r.grantee_principal_id = u.principal_id | |
Left Join sys.all_objects o |
NewerOlder