So you committed to main
instead of your feature branch? Oops! But it's ok. All commits in git are special little things that are easy to chip up and kick around ⚽
If you need to do any sleuthing first, use
git log
What gift of grace is Jesus my redeemer, | |
There is no more for heaven now to give | |
He is my joy, my righteousness, and freedom | |
My steadfast love, my deep and boundless peace | |
To this I hold, my hope is only Jesus | |
For my life is wholly bound to his | |
Oh how strange and divine, I can sing: all is mine! | |
Yet not I, but through Christ in me |
public static class StringExtensions | |
{ | |
public static string ReplaceFirst(this string target, string oldString, string newString) | |
{ | |
int start = target.IndexOf(oldString); | |
if (start < 0) | |
return target; | |
int end = start + oldString.Length; |
<html> | |
<head><style>div{margin:2em;} ul{padding:0;}</style> | |
<body> | |
<div> | |
<ul> | |
<li>Open the DevTools console</li> | |
<li>Press Go</li> | |
<li>Data will be fetched from server (<code>return await fetch().then()</code>)</li> | |
<li>Press Go again</li> | |
<li>Data will be returned locally from the async function (<code>return todos</code>)</li> |
# == 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 |
String.prototype.toSentenceCase = function(){ return this.slice(0,1).toUpperCase() + this.slice(1) } |
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 '' |
-- 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 |
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) |
SELECT | |
DB_NAME(dbid) as DBName, | |
COUNT(dbid) as NumberOfConnections, | |
loginame as LoginName | |
FROM | |
sys.sysprocesses | |
WHERE | |
dbid > 0 | |
GROUP BY | |
dbid, loginame |