add_filter('upload_dir', 'cdn_upload_url');
function cdn_upload_url($args)
{
$args['baseurl'] = 'https://your.awesomecdn.net/wp-content/uploads'; //Change to your base CDN directory - no trailing slash
return $args;
}
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
| image: node:8.15.0-jessie | |
| build: | |
| stage: build | |
| only: | |
| - master | |
| script: | |
| - cd site/web/app/themes/$THEME_DIR | |
| - yarn && yarn build:production | |
| artifacts: |
find . -type d \( -path ./node_modules -o -path ./vendor -o -path ./bower_components \) -prune -o -print
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/sh | |
| find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \; |
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 | |
| /* This sets the $time variable to the current hour in the 24 hour clock format */ | |
| $time = date("H"); | |
| /* Set the $timezone variable to become the current timezone */ | |
| $timezone = date("e"); | |
| /* If the time is less than 1200 hours, show good morning */ | |
| if ($time < "12") { | |
| echo "Good morning"; | |
| } else | |
| /* If the time is grater than or equal to 1200 hours, but less than 1700 hours, so good afternoon */ |
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 getGreetingTime (m) { | |
| var g = null; //return g | |
| if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return. | |
| var split_afternoon = 12 //24hr time to split the afternoon | |
| var split_evening = 17 //24hr time to split the evening | |
| var currentHour = parseFloat(m.format("HH")); | |
| if(currentHour >= split_afternoon && currentHour <= split_evening) { |
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
| type StringLiteralDiff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; | |
| type Omit<T, K extends keyof T> = Pick<T, StringLiteralDiff<keyof T, K>>; | |
| interface ComponentProps { | |
| propA: string | |
| propB: number | |
| propC: () => void | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.