This file contains 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
/** | |
* @desc Pretty time | |
*/ | |
function pretty_time($_DATE_FROM, $_DATE_TO, $_LANG) | |
{ | |
$SECOND = 1; | |
$MINUTE = 60 * $SECOND; | |
$HOUR = 60 * $MINUTE; | |
$DAY = 24 * $HOUR; | |
$MONTH = 30 * $DAY; |
This file contains 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 cherry-pick -n <commit> # get your patch, but don't commit (-n = --no-commit) | |
git reset # unstage the changes from the cherry-picked commit | |
git add -p # make all your choices (add the changes you do want) | |
git commit # make the commit! |
This file contains 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
tell application "Finder" | |
activate | |
set thisFolder to target of front Finder window | |
set the current view of front Finder window to icon view | |
set icon size of icon view options of front Finder window to 196 | |
set arrangement of icon view options of front Finder window to arranged by creation date | |
close front Finder window | |
open thisFolder | |
end tell |
This file contains 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
CREATE FUNCTION levenshtein( s1 VARCHAR(255), s2 VARCHAR(255) ) | |
RETURNS INT | |
DETERMINISTIC | |
BEGIN | |
DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT; | |
DECLARE s1_char CHAR; | |
-- max strlen=255 | |
DECLARE cv0, cv1 VARBINARY(256); | |
SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), cv1 = 0x00, j = 1, i = 1, c = 0; | |
IF s1 = s2 THEN |
This file contains 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
alfred://theme/searchForegroundColor=rgba(235,74,54,1.00)&resultSubtextFontSize=1&searchSelectionForegroundColor=rgba(243,255,248,1.00)&separatorColor=rgba(213,213,213,0.00)&resultSelectedBackgroundColor=rgba(0,224,167,0.78)&shortcutColor=rgba(255,255,255,0.00)&scrollbarColor=rgba(235,74,54,1.00)&imageStyle=9&resultSubtextFont=Helvetica&background=rgba(60,60,60,1.00)&shortcutFontSize=1&searchFontSize=4&resultSubtextColor=rgba(253,255,255,0.15)&searchBackgroundColor=rgba(60,60,60,1.00)&name=BIG%20Material%20Dark&resultTextFontSize=3&resultSelectedSubtextColor=rgba(254,246,255,0.50)&shortcutSelectedColor=rgba(255,255,255,0.51)&widthSize=4&border=rgba(60,60,60,0.00)&resultTextFont=Helvetica&resultTextColor=rgba(243,243,255,0.41)&cornerRoundness=2&searchFont=Helvetica&searchPaddingSize=4&credits=Jesus%20Leon&searchSelectionBackgroundColor=rgba(235,74,54,0.70)&resultSelectedTextColor=rgba(250,255,251,1.00)&resultPaddingSize=4&shortcutFont=Helvetica%20Neue |
This file contains 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
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;killall Finder |
This file contains 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
# Install linter | |
apm install lint | |
# Client-side linters | |
apm install linter-csslint,linter-htmlhint,linter-jshin,linter-jsonlintt | |
# Markup linters | |
apm install linter-js-yaml,linter-xmllint | |
# Php linters |
This file contains 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
tell application "System Events" | |
-- get properties of every process where background only is false | |
set listOfProcesses to (title of every process where background only is false) | |
tell me to set selectedProcesses to choose from list listOfProcesses with multiple selections allowed | |
end tell |
This file contains 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
function parse(template, data) { | |
var replacer = function (context) { | |
return function (placeholder, name) { | |
return context[name]; | |
}; | |
}; | |
return template.replace(/\{(\w+)\}/g, replacer(data)); | |
} |
This file contains 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
php-cs-fixer fix --fixers=multiline_array_trailing_comma,operators_spaces,return,unused_use,concat_with_spaces,short_array_syntax,whitespacy_lines . |
OlderNewer