The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| function youtubeDurationToSeconds(duration) { | |
| var hours = 0; | |
| var minutes = 0; | |
| var seconds = 0; | |
| // Remove PT from string ref: https://developers.google.com/youtube/v3/docs/videos#contentDetails.duration | |
| duration = duration.replace('PT',''); | |
| // If the string contains hours parse it and remove it from our duration string | |
| if (duration.indexOf('H') > -1) { |
| <?php | |
| /** | |
| * Utilize Constant Contact API v2 endpoints | |
| */ | |
| class ConstantContactV2 { | |
| /** | |
| * Username. | |
| * | |
| * @var string |
| "set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'VundleVim/Vundle.vim' | |
| Plugin 'ctrlpvim/ctrlp.vim' | |
| Plugin 'tpope/vim-sleuth' | |
| Bundle 'joonty/vdebug.git' | |
| call vundle#end() |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>local.mouse.ipcam.job</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/bin/ansible-playbook</string> | |
| <string>-i</string> |
| for f in $(find /path/to/file -mmin +0 -mmin -43200 -name '*.js' -or -mmin +0 -mmin -43200 -name '*.css'); | |
| do | |
| if [[ $f != *"/exclude_this_directory/"* ]] | |
| then command_to_run_against_match $f | |
| fi done; |
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
| SELECT | |
| om.mundane_id AS ORKID, | |
| om.persona, | |
| COUNT(*) AS numParagons, | |
| (SELECT COUNT(*) FROM ork_awards sub WHERE sub.mundane_id = om.mundane_id AND sub.`kingdomaward_id` IN(SELECT kingdomaward_id FROM ork_kingdomaward subk WHERE subk.award_id = 27)) as ootwCnt | |
| FROM | |
| ork_awards oa | |
| LEFT JOIN ork_kingdomaward oka ON oka.kingdomaward_id = oa.kingdomaward_id |