Skip to content

Instantly share code, notes, and snippets.

@whiteinge
whiteinge / waitlatestfrom.js
Created March 21, 2017 17:07
waitLatestFrom RxJS operator as a middle-ground between withLatestFrom and combineLatest
/**
waitLatestFrom(...sources, [selector])
Like withLatestFrom but waits for all sources to produce at least one value
before emitting. Emits immediately once it has a value for all sources. After
that it actively collects the latest emission from the other source observables
in the background and emits the latest collected values whenever the primary
source emits -- like withLatestFrom.
If the primary source completes, the other sources will be completed as well.
@metaskills
metaskills / gist:893599
Created March 29, 2011 23:54
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)