- redirects users where they wanted to go after logging in.
- Generic
SessionsHelperstore_location(usage)
redirect_back_or(usage)
| /** | |
| * This php script queries a form at http://www.lipsum.com/ to get a | |
| * hashed version of a provided or default password | |
| * | |
| * This script is run using the command 'lipsum p 4' where p stands for | |
| * paragraph and 4 is the number of paragraphs. Other option is w for words. | |
| * | |
| */ | |
| // Query in the form of two parameters 'type' and number of 'type' |
SessionsHelper
store_location (usage)redirect_back_or (usage)| # Install brew | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # Install composer | |
| brew install homebrew/php/composer | |
| ### PHPCS | |
| composer global require "squizlabs/php_codesniffer=*" | |
| # Add to your .bash_profile |
| #!/bin/bash | |
| mkdir wordpress-site && cd wordpress-site | |
| touch docker-compose.yml | |
| cat > docker-compose.yml <<EOL | |
| version: "2" | |
| services: | |
| my-wpdb: |
| <?php | |
| /** | |
| * Use namespace to avoid conflict | |
| */ | |
| namespace PostType; | |
| /** | |
| * Class Event | |
| * @package PostType | |
| * |
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
| <?php //<~ Remove me | |
| //Removes Title and Description on CPT Archive | |
| remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' ); | |
| //Removes Title and Description on Blog Archive | |
| remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' ); | |
| //Removes Title and Description on Date Archive | |
| remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' ); | |
| //Removes Title and Description on Archive, Taxonomy, Category, Tag | |
| remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); |
| sudo apt-get install libgnome-keyring-dev | |
| cd /usr/share/doc/git/contrib/credential/gnome-keyring | |
| sudo make | |
| sudo ln -s /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring /usr/lib/git-core/ |
| OPENWEATHER_APIKEY = "" # TODO add your apikey here | |
| lat = "49.868183" # latitude of the city you want to get the weather from | |
| lon = "8.626288499" # longitude of the city you want to get the weather from | |
| def getWeatherEmoji(weatherID) | |
| # Openweathermap Weather codes and corressponding emojis | |
| thunderstorm = "\u{1F4A8}" # Code: 200's, 900, 901, 902, 905 | |
| drizzle = "\u{1F4A7}" # Code: 300's | |
| rain = "\u{02614}" # Code: 500's |