- Word:
docx2txt
(brew install docx2txt
) - Excel:
xlsx2txt
- PDF:
pdf2txt
(brew install poppler
) - Images:
exiftool
(brew install exiftool
)
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
#!/bin/bash | |
# Might as well ask for password up-front, right? | |
sudo -v | |
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Example: do stuff over the next 30+ mins that requires sudo here or there. | |
function wait() { |
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
activate application "Finder" | |
delay 1 | |
tell application "System Events" | |
tell process "Finder" | |
click first menu item of menu 1 of menu item "Recent Folders" of menu 1 of menu bar item "Go" of menu bar 1 | |
end tell | |
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
// ES5 | |
var camelize = function(string) { | |
return string.replace(/-([a-z])/g, function(match) { | |
return match[1].toUpperCase(); | |
}); | |
}; | |
// ES6 (short one-liner) | |
const camelize = string => string.replace(/-([a-z])/g, match => match[1].toUpperCase()); |
Update: I've published a npm package for an even easier usage of this trick! See pascaliske/bsproxy.
Quickly proxy a local domain (e.g. http://my-site.dev
) for local network access.
- Globally install BrowserSync
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
// ---- | |
// libsass (v3.5.0.beta.2) | |
// ---- | |
// | |
// GLOBAL | |
// | |
@mixin cmp-base($component) { | |
.#{$component} { | |
@content; |
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
export function diff(color1: string, color2: string): number { | |
if (!color1 && !color2) { | |
return; | |
} | |
const _color1 = color1.charAt(0) == '#' ? color1.substring(1, 7) : color1; | |
const _color2 = color2.charAt(0) == '#' ? color2.substring(1, 7) : color2; | |
const rColor1 = parseInt(_color1.substring(0, 2), 16); | |
const gColor1 = parseInt(_color1.substring(2, 4), 16); |
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
body { | |
background-color: #002b36; | |
color: #839496; | |
font-size: 14px; | |
white-space: pre !important; | |
font-family: "Source Code Pro", monospace; | |
} | |
.property { | |
font-weight: bold; |
Note: Since macOS High Sierra (10.13) the directory /usr/local/bin
is not modifiable anymore (because of Apple's SIP feature). But using node
and npm
with sudo
is not advisable.
Generally it is best practice to install node using an dedicated version manager like n
or nvm
. This will handle permissions correctly and allows easy upgrading / downgrading the versions.
- Install
node
version managern
OlderNewer