Clone Mastodon's repository.
# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live
cd ~/live
for f in $(find path/to/client -name '*.js'); | |
do | |
ng-annotate -a $f -o $f; | |
echo $f; | |
done | |
echo "Done!"; |
# Turn on Notifications | |
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref | |
# Show Desktop | |
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder" | |
# Show all windows | |
tell application "System Events" | |
set visible of (every process) to true | |
end tell |
// This class implements the same interface that the cache created by $cacheFactory does | |
// See https://github.com/angular/angular.js/blob/master/src/ng/cacheFactory.js#L142 | |
// This cache evicts an entry once it's expired (which we define as 5 seconds). | |
class ExpirationCache { | |
constructor(timeout = 5000) { | |
this.store = new Map(); | |
this.timeout = timeout; | |
} | |
get(key) { |
version: '2' | |
services: | |
gitlab: | |
container_name: gitlab | |
image: gitlab/gitlab-ce:latest | |
restart: always | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
## GitLab configuration settings | |
##! Check out the latest version of this file to know about the different |
# ----------------------------------- # | |
webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt; | |
cd public/js/; # assumes all your files are here | |
find . -name "*.js" | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files | |
cd ../..; | |
cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'"; | |
rm files-processed.txt files-all.txt; | |
# ----------------------------------- # |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
/* Solarized Dark for embedded gists | |
http://ethanschoonover.com/solarized | |
*/ | |
.gist .highlight, .gist .blob-code-inner { font-size: inherit !important } | |
.gist .highlight { line-height: 1.25em !important } | |
.gist .gist-meta { background-color: #073642 !important; color: #93a1a1 !important } | |
.gist .gist-meta a { color: #268bd2 !important } | |
.gist .gist-data, .gist .highlight { background-color: #002b36 !important; color: #93a1a1 !important } |
const os = require('os'); | |
const exec = require('child_process').exec; | |
switch (os.platform()) { | |
case 'win32': | |
exec('yarn --version', (err, stdout, stderr) => { | |
if (err) { | |
exec('npm install'); | |
return; | |
} else { |