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
| // Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
| // See also: http://www.paulund.co.uk/change-url-of-git-repository | |
| $ cd $HOME/Code/repo-directory | |
| $ git remote rename origin bitbucket | |
| $ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
| $ git push origin master | |
| $ git remote rm bitbucket |
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
| import jsonStore from "json-store"; | |
| const store = jsonStore(); | |
| const data = await store.list(); |
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
| // Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/ | |
| $ git add . | |
| $ git status // to see what changes are going to be commited | |
| $ git commit -m 'Some descriptive commit message' | |
| $ git push origin master | |
| $ git checkout gh-pages // go to the gh-pages branch | |
| $ git rebase master // bring gh-pages up to date with master | |
| $ git push origin gh-pages // commit the changes |
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
| // Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
| $ git ls-files | xargs wc -l |
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
| // Reference: http://stackoverflow.com/questions/936249/stop-tracking-and-ignore-changes-to-a-file-in-git | |
| $ git rm --cached -r <dir> |
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
| <?php | |
| /** | |
| * Add the metabox. | |
| */ | |
| function my_url_add_metabox() { | |
| add_meta_box( | |
| 'my_url_section', // The HTML id attribute for the metabox section | |
| 'My URL Metabox Title', // The title of your metabox section |
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
| #!/bin/bash | |
| # Usage: | |
| # $ chmod +x init-letsencrypt.sh | |
| # $ init-letsencrypt.sh mydomain.com bob@email.com 1 | |
| # | |
| # Reference: | |
| # https://medium.com/@pentacent/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71 | |
| domain=${1} |
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 populate_concept_nominees( $form ){ | |
| foreach ( $form['fields'] as &$field ){ | |
| // Set a custom CSS class for your field and grab onto it here | |
| if ( $field['type'] != 'select' || strpos( $field['cssClass'], 'populate-concept' ) === false ) | |
| continue; | |
| // Query parameters for get_posts |
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
| // Usage (from `server` directory): | |
| // $ node -r dotenv/config -r esm src/scripts/seedData.js <PASSWORD> | |
| import faker from "faker"; | |
| import gravatarUrl from "gravatar-url"; | |
| import mongoose from "mongoose"; | |
| import auth0 from "../config/auth0"; | |
| import initMongoose from "../config/mongoose"; | |
| import Post from "../models/Post"; |
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 limit_file_upload_size( $validation_result ) { | |
| $form = $validation_result['form']; | |
| foreach( $form['fields'] as &$field ){ | |
| // NOTE: Add a custom CSS class to your image upload field and grab onto it here... | |
| if( strpos( $field['cssClass'], 'choose-file' ) === false ) | |
| continue; | |
NewerOlder