Skip to content

Instantly share code, notes, and snippets.

USE [master]
DECLARE @dbName NVARCHAR(MAX)
SET @dbName ='Derp' -- Your DB name here
DECLARE @sql NVARCHAR(MAX)
DECLARE @template NVARCHAR(MAX)
DECLARE @dataDir NVARCHAR(MAX)
SET @dataDir = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) FROM master.sys.master_files WHERE database_id = 1 AND file_id = 1)
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
SELECT L.request_session_id AS SPID,
DB_NAME(L.resource_database_id) AS DatabaseName,
O.Name AS LockedObjectName,
P.object_id AS LockedObjectId,
L.resource_type AS LockedResource,
L.request_mode AS LockType,
ST.text AS SqlStatementText,
ES.login_name AS LoginName,
ES.host_name AS HostName,
TST.is_user_transaction as IsUserTransaction,
SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1)
FROM master.sys.master_files
WHERE database_id = 1 AND file_id = 1
/**
Copy compile dependencies to $webAppDirName/WEB-INF/lib
Creates a eclipse project with all dependencies that compiles classes into
$webAppDirName/WEB-INF/classes and test classes into /build/test-classes.
Requires: gradle 1.0rc2 or greater
We are using this gradle file:
@gsitgithub
gsitgithub / sql-server-dbconstraint.sql
Created August 11, 2015 11:52
QL Server Default Constraints problem (Manipulation)
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE <dbname> SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE <dbname> SET MULTI_USER;
================================================================================================================
SQL Server Default Constraints problem (Manipulation)
================================================================================================================
SELECT * FROM dbo.sysobjects where id > 98 order by name where name = 'ACT_FK_MODEL_SOURCE';
SELECT * FROM dbo.sysobjects where id > 98 and name = 'ACT_FK_MODEL_SOURCE';
================================================
@gsitgithub
gsitgithub / EclipseCodeFormatterExport.xml
Last active October 15, 2015 05:44
Eclipse Code formatter settings, import it to your eclipse ide.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="gsitgithub" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
@gsitgithub
gsitgithub / idiomatic-javascript-formatter-eclipse.xml
Last active October 20, 2015 08:42
Style guide javascript import XML for Eclipse JavaScript formatting
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="11">
<profile kind="CodeFormatterProfile" name="idiomatic" version="11">
<setting id="org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.wst.jsdt.core.formatter.alignment_for_compact_if" value="16"/>
@gsitgithub
gsitgithub / Installing the Subclipse Plugin in eclipse
Last active August 25, 2016 09:29
Subclipse Plugin in eclipse
Please note that the way how to install plugins differs from each version of Eclipse to the next one.
The following description is for Eclipse 3.5 - 4.3. See http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
for more detailed information by the plugin provider.
If not installing on Windows (32-bit), i.e. on Linux, Mac OS X, or Windows 64-bit, first have a look at the notes below,
as you first need to install Subversion for your operating system.
In Eclipse, select the menu "Help > Install New Software".
Enter the Update Site, depending on your version of subversion you installed:
If you installed Subversion 1.6: http://subclipse.tigris.org/update_1.6.x
If you installed Subversion 1.7: http://subclipse.tigris.org/update_1.8.x
@gsitgithub
gsitgithub / dashboard.txt
Created August 11, 2017 13:09
java libs and tools info
https://vpsfree.org
https://vestacp.com/
http://browserstack.com
Good analysis. People rush to “optimize the code” but they don’t bother to measure or look for the best algorithm.
Bug Hunting
https://amybughunter.files.wordpress.com/2013/01/defect_tracking_decide1.jpg
# mssql jdbc driver installation in maven for now on Nexus repository