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 | |
mkdir -p logs | |
npm install | |
lerna bootstrap | |
# Start RabbitMQ / Redis and Mongodb | |
docker-compose -f docker/docker-compose.yml up -d | |
sleep 10 |
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
# Force push | |
git push --force | |
# Pull origin when origin has been force pushed (from master branch) | |
git reset --hard origin/master | |
# Base feature branch on new force-pushed master | |
# Assumes feature branch has 2 commits | |
git rebase HEAD~2 myfeature --onto master |
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
// Trello | |
// Add a List for each weekday | |
// Pass throught https://skalman.github.io/UglifyJS-online/ | |
// Then add 'javascript:' before the code | |
// and add 'void(0);' after the code | |
// Add a bookmark in Chrome and put this as the url | |
(function () { | |
function getLastDate (lastDate = null) { |
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 | |
# Source: https://stackoverflow.com/questions/32076878/logging-solution-for-multiple-containers-running-on-same-host | |
# Creator: Nate | |
names=$(docker ps --format "{{.Names}}") | |
echo "tailing $names" | |
while read -r name | |
do |
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
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for inside folders | |
@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
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
#!/usr/bin/env bash | |
# Set GIT variables via LC variables | |
# LC gets default passed via ssh | |
# Put this in .bash_profile | |
if [[ -z "${GIT_AUTHOR_NAME}" ]]; then | |
if [[ -n "${LC_GIT_AUTHOR_NAME}" ]]; then | |
export GIT_AUTHOR_NAME="${LC_GIT_AUTHOR_NAME}" |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 ubuntu in virtual machine | |
# https://ubuntuforums.org/showthread.php?t=1481300 | |
# Get arch type of ubuntu | |
# i686 = 32 bit | |
# x86_64 = 64 bit | |
uname -m | |
# download forticlient | |
https://hadler.me/linux/forticlient-sslvpn-deb-packages |
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
# Remove file/folder from history | |
git filter-branch -f --tree-filter 'rm -rf vendor/gems' HEAD | |
# or | |
git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD | |
# Run git garbage collection | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now | |
# overwrite remote |
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 | |
class stdObject { | |
public function __call($method, $arguments) { | |
return call_user_func_array(Closure::bind($this->$method, $this, get_called_class()), $arguments); | |
} | |
} | |
$obj = new stdObject(); | |
$obj->test = function() { |