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
Create the following list of items: Apples, Cherries, Pears, Pineapple, Peaches, Mango. Then print the list | |
Add "Grapes" to the list and print the list | |
Change "Pears" to "Strawberries" and print the list | |
Remove "Apples" from the list and print the list | |
Print out the current length of the list | |
Order the list alphabetically | |
Print out the list again |
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
class custom_nginx { | |
package { 'nginx': | |
ensure => latest, | |
} | |
file { '/etc/nginx/nginx.conf': | |
source => 'puppet:///modules/custom_nginx/etc/nginx/nginx.conf', | |
group => 'root', | |
owner => 'root', |
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 | |
# Run a bunch of checks on the data entered | |
if [ "$#" -lt 2 ] || [ "$#" -gt 2 ] | |
then | |
echo "Usage '$0 <starting number> <ending number>'"; | |
exit; | |
fi | |
if [ $1 -lt 0 ] |
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 | |
/* | |
* File data: | |
* aaa jkj dfd qwerty | |
* fff aaa bbb qwerty | |
* jkj dfd bbb | |
* aaa aaa aaa qwerty | |
* | |
* Usage: php 2.php data.txt | |
* |
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 getNestedObjectValue(objObject, strKey) { | |
//split the key into parts | |
let arrParts = strKey.split('/'); | |
//get array length before loop for optimisation | |
let numLength = arrParts.length; | |
//create variable to hold object position | |
let mixValue = objObject; |
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 getNestedObjectValue(objObject, strKey) { | |
//split the key into parts | |
let arrParts = strKey.split('/'); | |
//get array length before loop for optimisation | |
let numLength = arrParts.length; | |
//create variable to hold object position | |
let mixValue = objObject; |
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
<data-source :source="https://dataprovider"> | |
<div slot-scope="{ items }"> | |
<data-show-item :item="item" v-for="item in items" /> | |
</div> | |
</data-source> |
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
<script> | |
export default { | |
name: 'data-source', | |
props: { | |
source: { | |
type: String, | |
required: true | |
} | |
}, | |
data: function() { |
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 | |
strBaseFolder=`pwd`/ | |
strDate=`date +"%Y-%m-%d"` | |
strTime=`date +"%H:%M:%S %z"` | |
if [ "$#" == 0 ] || [ "$#" -gt 1 ] ; then | |
echo "Usage: $0 'post title'" | |
exit; | |
fi |
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
<p>Hello Kwoosh</p> |
NewerOlder