$ git branch -d feature/blah
$ git branch -d -r origin/feature/blah
$ git push origin :feature/blah
$ git push origin :feature/blah
$ git push origin :b55bc88
Checkout the feature branch that needs rebasing:
$ git checkout feature/blah
Then rebase onto develop
:
$ git rebase develop
Then force upstream feature branch to match local one:
I had a repo once where master
had gone off on a tangent from develop, stuff another developer did, and I
wanted to bring it back to the commit where it first forked off from develop
. Even though the remote origin
had been synced with local master
, I knew that no other developer had worked on that branch, and I could
safely revert. So just say the commit I wanted to revert to was 56b33e4
:
# make sure we are on master
$ git checkout master
/* | |
* Apply a transparent gauze to the bottom of a truncated, "read-more" section. | |
*/ | |
.comment-body-view.truncated:after { | |
background: linear-gradient(to top, #eee, rgba(238,238,238,0)); | |
bottom: 0; | |
content: ""; | |
height: 50px; | |
left: 0; | |
position: absolute; |
<?php | |
/** | |
* a front end for yiic.php that looks for env on cmdline and sets CRAFT_ENVIRONMENT | |
* accordingly. I put this script in a folder called "utils" in the root of my website | |
* install. So instead of doing something like | |
* php $root/craft/app/etc/console/yiic.php plugin cmd | |
* you would call | |
* php $root/utils/yiic_frontend.php --env=envname plugin cmd | |
* where "envname" is the config environment you wish to use. |
I use Eloquent ORM in Laravel apps. I am torn between raw SQL (where you have a lot of power) and using an ORM, but a lot of times you can kinda walk a tightrope between the two. This gist is a way of collecting cool, more unusual Eloquent query techniques and tips and tricks.
insert a new row or update an existing one in one statement. updateOrCreate
takes two params, an array of attributes to search table on, and then an array of values to set if an existing record is found
Model::updateOrCreate([ 'user_id' => $user->user_id ], [ 'name' => 'bob' ]);
This gist is a way of collecting cool, more unusual MySQL query techniques and tips and tricks.
use this to convert column values to more useful defaults if they are null. can be used in formulas, order by etc.
in this example, using ifnull()
avoids sums using columns that have null
values ending up as null
#!/bin/bash | |
# see https://blog.agilebits.com/2011/06/21/toward-better-master-passwords/ | |
# and http://world.std.com/~reinhold/diceware.wordlist.asc | |
DICEWARE_STASH_FILE=~/tmp/diceware.txt | |
WORDS=$1 | |
[[ "$WORDS" == "" ]] && WORDS=5 | |