| git push origin <tag_name>
|
https://snipt.net/embed/c26ef96bd24d69db2273cdd03991bcc9/
/raw/c26ef96bd24d69db2273cdd03991bcc9/
c26ef96bd24d69db2273cdd03991bcc9
text
Text only
1
2025-04-03T18:56:32
True
False
False
Jun 08, 2023 at 01:55 PM
/api/public/snipt/122/
push-with-tag
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git push origin <tag_name>
</span></pre></div>
</td></tr></table>
git
| git branch -D branch_name
git push ascend -d branch_name
|
https://snipt.net/embed/d03543e5094e8e9327d0e09d790ce137/
/raw/d03543e5094e8e9327d0e09d790ce137/
d03543e5094e8e9327d0e09d790ce137
text
Text only
3
2025-04-03T18:51:29
True
False
False
May 22, 2023 at 07:44 PM
/api/public/snipt/121/
delete-branch-local-and-remote
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git branch -D branch_name
</span><span id="L-2"><a name="L-2"></a>git push ascend -d branch_name
</span></pre></div>
</td></tr></table>
git
| git revert -m 1 <merge-commit-hash>
|
https://snipt.net/embed/d9432524940114c0aa385cebc14a0780/
/raw/d9432524940114c0aa385cebc14a0780/
d9432524940114c0aa385cebc14a0780
text
Text only
1
2025-04-03T18:51:30
True
False
False
Apr 14, 2023 at 01:28 PM
/api/public/snipt/120/
revert-merge-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git revert -m 1 <merge-commit-hash>
</span></pre></div>
</td></tr></table>
git
| git commit --amend -m "xxxx merge into xx resolve conflict"
|
https://snipt.net/embed/4b22fc4298bdcb821c6e3618c53d674c/
/raw/4b22fc4298bdcb821c6e3618c53d674c/
4b22fc4298bdcb821c6e3618c53d674c
text
Text only
1
2025-04-03T18:52:19
True
False
False
/api/public/snipt/119/
update-last-commit-message
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git commit --amend -m "xxxx merge into xx resolve conflict"
</span></pre></div>
</td></tr></table>
git
| # Check the log to get the hash
git log --oneline
git reset --hard <hash>
|
https://snipt.net/embed/31a8fbd4a05e38940ca39a079524ee64/
/raw/31a8fbd4a05e38940ca39a079524ee64/
31a8fbd4a05e38940ca39a079524ee64
text
Text only
5
2025-04-03T18:49:38
True
False
False
Sep 24, 2021 at 01:16 PM
/api/public/snipt/118/
git-revert-to-previous-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a># Check the log to get the hash
</span><span id="L-2"><a name="L-2"></a>git log --oneline
</span><span id="L-3"><a name="L-3"></a>
</span><span id="L-4"><a name="L-4"></a>git reset --hard <hash>
</span></pre></div>
</td></tr></table>
git
| PURGE BINARY LOGS BEFORE '2021-06-25 00:00:00';
|
https://snipt.net/embed/cadd029c1890864b638dd9bef556129a/
/raw/cadd029c1890864b638dd9bef556129a/
cadd029c1890864b638dd9bef556129a
text
Text only
1
2025-04-03T18:52:19
True
False
False
Jun 24, 2021 at 07:45 PM
/api/public/snipt/117/
purge-binary-logs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>PURGE BINARY LOGS BEFORE '2021-06-25 00:00:00';
</span></pre></div>
</td></tr></table>
mysql
| SELECT
SUM(base.size) AS `Size in MB`
FROM(
SELECT
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS size
FROM information_schema.TABLES
) AS base
|
https://snipt.net/embed/97488ca92ded3bb5e00eb6f4ac978f17/
/raw/97488ca92ded3bb5e00eb6f4ac978f17/
97488ca92ded3bb5e00eb6f4ac978f17
text
Text only
7
2025-04-03T18:50:37
True
False
False
Apr 17, 2021 at 09:37 PM
/api/public/snipt/116/
get-total-size-of-db
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a>
<a href="#L-5">5</a>
<a href="#L-6">6</a>
<a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>SELECT
</span><span id="L-2"><a name="L-2"></a> SUM(base.size) AS `Size in MB`
</span><span id="L-3"><a name="L-3"></a>FROM(
</span><span id="L-4"><a name="L-4"></a> SELECT
</span><span id="L-5"><a name="L-5"></a> ROUND(((data_length + index_length) / 1024 / 1024), 2) AS size
</span><span id="L-6"><a name="L-6"></a> FROM information_schema.TABLES
</span><span id="L-7"><a name="L-7"></a>) AS base
</span></pre></div>
</td></tr></table>
mysql
| $categories = ArrayHelper::map(Category1::find()->where(['class_id' => $class_id])->all(), 'category_1_id', 'name');
|
https://snipt.net/embed/4b6b292e9d5b1e3b741e1fbf84732d34/
/raw/4b6b292e9d5b1e3b741e1fbf84732d34/
4b6b292e9d5b1e3b741e1fbf84732d34
text
Text only
1
2025-04-03T18:49:38
True
False
False
Feb 09, 2021 at 08:09 PM
/api/public/snipt/115/
yii2-array-map-to-model
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$categories = ArrayHelper::map(Category1::find()->where(['class_id' => $class_id])->all(), 'category_1_id', 'name');
</span></pre></div>
</td></tr></table>
yii
| $css = <<<CSS
CSS;
$this->registerCss($css);
|
https://snipt.net/embed/d0c15232021efbea66042c4a8d3772e6/
/raw/d0c15232021efbea66042c4a8d3772e6/
d0c15232021efbea66042c4a8d3772e6
text
Text only
5
2025-04-03T18:50:37
True
False
False
Jan 24, 2021 at 06:48 PM
/api/public/snipt/114/
css-on-view
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a>
<a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$css = <<<CSS
</span><span id="L-2"><a name="L-2"></a>
</span><span id="L-3"><a name="L-3"></a>CSS;
</span><span id="L-4"><a name="L-4"></a>
</span><span id="L-5"><a name="L-5"></a>$this->registerCss($css);
</span></pre></div>
</td></tr></table>
yii
| git push -f <remote> <branch>
e.g. git push -f origin master <-- Don't use master
Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.
|
https://snipt.net/embed/501243ea466193f664fac3097323f58c/
/raw/501243ea466193f664fac3097323f58c/
501243ea466193f664fac3097323f58c
text
Text only
5
2025-04-03T18:53:52
True
False
False
/api/public/snipt/113/
force-push-branch
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a>
<a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git push -f <remote> <branch>
</span><span id="L-2"><a name="L-2"></a>
</span><span id="L-3"><a name="L-3"></a>e.g. git push -f origin master <-- Don't use master
</span><span id="L-4"><a name="L-4"></a>
</span><span id="L-5"><a name="L-5"></a>Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.
</span></pre></div>
</td></tr></table>
git