git checkout --orphan newBranch
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
This file contains hidden or 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 findUberTripDetails() { | |
| // Replace with the desired label, Spreadsheet ID, and sheet name. | |
| var labelName = 'Uber/Family/New'; // This label is added when Gmail receives a new email | |
| var newLabelName = 'Uber/Family'; // This is label we will add at the end | |
| var spreadsheetId = 'yourSpreadsheetID'; // You can get this from the Google Sheets URL | |
| var sheetName = 'UberFamily'; // The tab/sheet name | |
| // Open the spreadsheet and get the desired sheet. | |
| var spreadsheet = SpreadsheetApp.openById(spreadsheetId); | |
| var sheet = spreadsheet.getSheetByName(sheetName); |
This file contains hidden or 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
| document.addEventListener("DOMContentLoaded", function(event) { | |
| $('.heroToggle .switch-input').attr('type','radio').attr('group','heroToggle') | |
| $('input[group="heroToggle"]').on('click change', function(){ | |
| $('input[group="heroToggle"]').not(this).prop('checked', false).each(function(){ | |
| var form = $(this).closest('form.total-form'), | |
| slug = $('input[name=slug]', form).val(); | |
| type = 'toggle'; | |
| $.ajax({ | |
| type: "POST", | |
| url: stacks.totalcms.totalapi, |
This file contains hidden or 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
| // add all the elements inside modal which you want to make focusable | |
| const focusableElements = | |
| 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'; | |
| const modal = document.querySelector('#exampleModal'); // select the modal by it's id | |
| const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal | |
| const focusableContent = modal.querySelectorAll(focusableElements); | |
| const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal | |
This file contains hidden or 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/sh | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: $0 OLD_VERSION NEW_VERSION" >&2 | |
| exit 1 | |
| fi | |
| export OLD=$1 | |
| export NEW=$2 |
Let's say alice is a github.com user, with 2 or more private repositories repoN.
For this example we'll work with just two repositories named repo1 and repo2
https://github.com/alice/repo1
https://github.com/alice/repo2
You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.
You want to perform git pull origin master for example, and you want this to happen without asking for a password.
This file contains hidden or 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 | |
| read -r -d '' usage << EOM | |
| Usage: | |
| gh-deploy-clone user/repo [ENVIRONMENT] | |
| EOM | |
| [ -z "$1" ] && echo && echo "$usage" && echo && exit 1 |