Skip to content

Instantly share code, notes, and snippets.

View HenrikHoyer's full-sized avatar

Henrik Hoyer HenrikHoyer

View GitHub Profile
@HenrikHoyer
HenrikHoyer / gist:9681378
Created March 21, 2014 07:34
Build Hierarchial tree of companies
WITH
under_comp(id, alias, level, sort) AS (
select id, alias, 0 as level, cast(alias as varchar(max)) from cdmcomp where id = '16281-----SPPL-SPPL'
UNION ALL
SELECT cdmcomp.id, cdmcomp.alias, under_comp.level+1, sort + ':' + cdmcomp.alias
FROM cdmcomp JOIN under_comp ON cdmcomp.primComp=under_comp.id
)
SELECT
id,
@HenrikHoyer
HenrikHoyer / gist:9681053
Created March 21, 2014 07:06
Show last statements executed on an sql server
SELECT execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql
ORDER BY execquery.last_execution_time DESC
@HenrikHoyer
HenrikHoyer / gist:2997470
Created June 26, 2012 17:54
Change all repositories to use a location relative to the location of vdevw.exe
RepositorySpec allInstances do: [:spec |
| locator |
locator := spec fileSystemLocator.
(locator isVolumeRelative not and: [ locator drive asUppercase = (KernelLibrary getModuleFileName: nil) asFileSystemPath drive asUppercase ]) ifTrue: [
locator absolute: #volumeRelative.
locator componentNames: (locator componentNames copyFrom: 2).
].
].
@HenrikHoyer
HenrikHoyer / gist:2997441
Created June 26, 2012 17:52
Change the VSE VM memory limits
x := 500.
path := 'c:\temp\360.exe'.
y := VirtualMachineConfiguration fromFile: path.
newSpace := y newSpaceBytes = 0 ifTrue: [ 256 * 1024 ] ifFalse: [ y newSpaceBytes ].
flipSpace := y flipSpaceBytes = 0 ifTrue: [ 256 * 1024 ] ifFalse: [ y flipSpaceBytes ].
padding := y paddingSizeBytes = 0 ifTrue: [ 32 * 1024 ] ifFalse: [ y paddingSizeBytes ].
y arenaBytes: (x * 1024 * 1024 ).
@HenrikHoyer
HenrikHoyer / gist:2997427
Created June 26, 2012 17:51
Finding references to a global Class from within a specific cluster
ToolInterface current
browseReferencesTo: (TeamVInterface current definitionOfGlobalNamed: #OrderedCollection)
in: (TeamVInterface current clusterNamed: 'My Cluster').