This file contains hidden or 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
| # == Check how many commits to move == | |
| git log | |
| # == Move commits to a new branch == | |
| # Creates the branch at current HEAD but doesn't check it out: | |
| git branch new-branch | |
| # Resets master/main/current back x commits | |
| git reset --keep HEAD~2 |
This file contains hidden or 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
| String.prototype.toSentenceCase = function(){ return this.slice(0,1).toUpperCase() + this.slice(1) } |
This file contains hidden or 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 | |
| dm_mid.database_id AS DatabaseID, | |
| dm_migs.avg_user_impact*(dm_migs.user_seeks+dm_migs.user_scans) Avg_Estimated_Impact, | |
| dm_migs.last_user_seek AS Last_User_Seek, | |
| object_name(dm_mid.object_id,dm_mid.database_id) AS [TableName], | |
| 'CREATE INDEX [IX_' + object_name(dm_mid.object_id,dm_mid.database_id) + '_' | |
| + REPLACE(REPLACE(REPLACE(ISNULL(dm_mid.equality_columns,''),', ','_'),'[',''),']','') + | |
| CASE | |
| WHEN dm_mid.equality_columns IS NOT NULL AND dm_mid.inequality_columns IS NOT NULL THEN '_' | |
| ELSE '' |
This file contains hidden or 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
| -- QUERY TO GET RUNNING PLAN HANDLES | |
| SELECT d.name, t.text,PLAN_HANDLE, r.total_elapsed_time/1000 RunningSeconds | |
| FROM sys.dm_exec_requests r | |
| JOIN sys.databases d on d.database_id = r.database_id | |
| CROSS APPLY sys.dm_exec_sql_text(sql_handle) t | |
| ORDER BY 4 DESC | |
| -- VISUALISE A PLAN HANDLE |
This file contains hidden or 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 | |
| d.name, | |
| t.text, | |
| r.total_elapsed_time/1000 as [Time], | |
| r.blocking_session_id, | |
| SUBSTRING(t.text,r.statement_start_offset/2 +1, | |
| (CASE WHEN r.statement_end_offset = -1 | |
| THEN LEN(CONVERT(NVARCHAR(MAX), t.text)) * 2 | |
| ELSE r.statement_end_offset END - | |
| r.statement_start_offset)/2) |
This file contains hidden or 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 | |
| DB_NAME(dbid) as DBName, | |
| COUNT(dbid) as NumberOfConnections, | |
| loginame as LoginName | |
| FROM | |
| sys.sysprocesses | |
| WHERE | |
| dbid > 0 | |
| GROUP BY | |
| dbid, loginame |
This file contains hidden or 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
| <html> | |
| <head> | |
| <style> | |
| @keyframes slideMoon{0%{left:-40%} | |
| to{left:145%} | |
| } | |
| @keyframes slideEarth{0%{left:-60%} | |
| to{left:145%} | |
| } |
This file contains hidden or 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
| ngOnInit(): void { | |
| // Form field subscribes to self | |
| // In FormGroup | |
| this.anotherForm.controls.scoops.valueChanges.subscribe(value => { | |
| this.anotherForm.controls.scoops.setValue(value, { onlySelf: true, emitEvent: false, emitModelToViewChange: true }); | |
| }, error => { }, () => { }); | |
| // Standalone FormControl | |
| this.flavour.valueChanges.subscribe(value => { |
This file contains hidden or 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
| const skippingIterator = (x, skip, limit) => | |
| { | |
| return 1 + ((skip * x) % limit) + (Math.floor((skip * x)/limit)); | |
| } | |
| const limit = 36; | |
| for (let i = 0; i < limit; i++) | |
| { | |
| console.log(i, skippingIterator(i, 3, limit)); | |
| } |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| [{"kanji":"δΊ","kun_readings":["γ€.γ"],"on_readings":["γ’"],"name_readings":["γ","γ€γ","γ€γ"],"jlpt":1,"unicode":"4e9c","heisig_en":"Asia"},{"kanji":"ε","kun_readings":["γγ"],"on_readings":["γ’","γ’γ―"],"name_readings":[],"jlpt":null,"unicode":"5516","heisig_en":"babble"},{"kanji":"ε¨","kun_readings":["γγ€γ.γγ"],"on_readings":["γ’","γ’γ€","γ―"],"name_readings":["γ"],"jlpt":null,"unicode":"5a03","heisig_en":"fair"},{"kanji":"ιΏ","kun_readings":["γγγ.γ","γγΎ"],"on_readings":["γ’","γͺ"],"name_readings":["γ»γ¨γ","γγ","γγ","γγ","γγ","γͺ"],"jlpt":1,"unicode":"963f","heisig_en":"Africa"},{"kanji":"ε","kun_readings":["γγ.γ","γγ.γγ","γγͺ.γγ"],"on_readings":["γ’γ€"],"name_readings":[],"jlpt":1,"unicode":"54c0","heisig_en":"pathetic"},{"kanji":"ζ","kun_readings":["γγ¨.γγ","γγͺ.γγ","γ.γ§γ","γ.γγ","γΎγͺ"],"on_readings":["γ’γ€"],"name_readings":["γ","γγ","γ","γγͺ","γͺγ","γγ","γγγΏ","γγ","γ‘γ"],"jlpt":2,"unicode":"611b","heisig_en":"love"},{"kanji":"ζ¨","kun_readings":["γ²γ.γ"],"on_readings":["γ’γ€"],"name_readings":[],"jlpt":null,"unicode":"6328","heisig_en":"s |