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
# my-prompt-customizations | |
# 1. Setup my prompt | |
# 1.1. get current branch in git repo | |
function parse_git_branch() { | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ ! "${BRANCH}" == "" ] | |
then | |
STAT=`parse_git_dirty` | |
echo "[${BRANCH}${STAT}]" | |
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
#!/bin/sh | |
git filter-branch --env-filter ' | |
OLD_EMAIL="put old email here" | |
CORRECT_NAME="put new name here" | |
CORRECT_EMAIL="put new email here" | |
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
then |
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
# %1 GitHub username | |
# %2 Repository name | |
# %3 Make repository private. User true or false | |
curl -u '%1' https://api.github.com/user/repos -d '{"name":"%2","private":"%3"}' |
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
//jshint esnext:true |
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
``` | |
\n\s*<flowAccesses>\n([\S ]*\n){1}[\S ]*Play_Changed<[\S ]*\n([\S ]*\n){0}[\S ]*</flowAccesses> | |
``` | |
{1} : number of lines *between* the outter open element and the line with the text to match; | |
< at the end of `Play_Changed<` : terminator to avoid matching text that starts with Play_Changed; | |
{0} : number of lines *between* the line with the text to match and the outter close element; |
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
#!/bin/sh | |
# git | |
alias g='git' | |
alias gs='git status' | |
alias gc='git add . && git commit -m' | |
alias ga='git add . && git commit --amend --no-edit' | |
alias gl='git log --oneline' | |
alias gpush='git push' | |
alias gpull='git pull' |
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
# git | |
Set-Alias -Name g -Value git -Option ReadOnly | |
Function Git-Status { git status $args } | |
Set-Alias -Name gs -Value Git-Status -Option ReadOnly | |
Function Git-Commit { | |
git add . | |
git commit -m $args | |
} |
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
public class ExpensesSelector { | |
public static Map<Id, Expense> selectAll() { | |
return dataService.selectAll(); | |
} | |
private static ExpensesDataService dataService { | |
get { | |
if (null == dataService) { | |
// use with sharing by default |
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
List<Case> cases = new List<Case>{ | |
new Case(Subject = 'Mild problem', Origin = 'Phone', Escalated__c = false, Status = 'Closed') | |
, new Case(Subject = 'Problem 1', Origin = 'Web', Escalated__c = true, Status = 'Closed') | |
, new Case(Subject = 'Problem 2', Origin = 'Web', Escalated__c = true, Status = 'In Progress') | |
, new Case(Subject = 'Problem 3', Origin = 'Email', Escalated__c = true, Status = 'Open') | |
}; | |
class MildCase extends CaseEntity { | |
protected override Edl.Expression identityExpression() { | |
return subject().isEqualTo('Mild problem'); |
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
{ | |
"parser": "@babel/eslint-parser", | |
"parserOptions": { | |
"requireConfigFile": false, | |
"babelOptions": { | |
"parserOpts": { | |
"plugins": ["classProperties", ["decorators", { "decoratorsBeforeExport": false }]] | |
} | |
} | |
}, |
OlderNewer