Skip to content

Instantly share code, notes, and snippets.

View edm00se's full-sized avatar

Eric McCormick edm00se

View GitHub Profile
@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active April 16, 2025 03:16
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

@tjadhav
tjadhav / annonate.sh
Created March 27, 2018 12:32
Annonate all AngularJS files
for f in $(find path/to/client -name '*.js');
do
ng-annotate -a $f -o $f;
echo $f;
done
echo "Done!";
@zehfernandes
zehfernandes / pliim-turnOff.scpt
Last active September 16, 2024 06:39
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# 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
@ccnokes
ccnokes / custom-cache-ng1.js
Last active August 21, 2017 03:11
Use a custom cache class in angularJS $http
// 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) {
@boiyama
boiyama / docker-compose.yml
Created April 6, 2017 07:51
docker-compose.yml configuring GitLab with Container Registry, Pages, CI, Mattermost (enabled WebRTC), and some other options
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
@xjamundx
xjamundx / webpack-unused-files.sh
Last active November 20, 2020 12:51
Quickly identify files unused by webpack
# ----------------------------------- #
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;
# ----------------------------------- #
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 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
});
}
@peterdemartini
peterdemartini / command.sh
Last active March 6, 2025 07:29
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@RomkeVdMeulen
RomkeVdMeulen / gists-solarized-dark.css
Created November 9, 2016 12:58
CSS for styling embedded gists in Solarized Dark
/* 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 }
@jsynowiec
jsynowiec / yarn-or-npmi.js
Last active April 28, 2019 10:50
[yarn with npm fallback] Try to install dependencies using yarn or fall back to npm if yarn is not available #nodejs #yarn #npm
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 {