defaults write com.apple.dock persistent-apps -array-add '{tile-type="spacer-tile";}'
killall Dock
exit
| <script> | |
| // | |
| // This code is taking the url http://example.com/index.asp?person=john | |
| // We're after the value from the parameter 'person' and setting it to an inputbox on the page | |
| // | |
| function getParameterByName(name, url) { | |
| // If the URL variable is null | |
| if (!url) { |
| Set-ExecutionPolicy RemoteSigned | |
| # Prompt for the account name | |
| $username = Read-Host "Account name" | |
| # Get the current expiry date | |
| $accexp = Get-LocalUser -Name $username | select AccountExpires | |
| # Display the account name with the expiry date in a easy to read format | |
| Write-Host "Account " -NoNewline; Write-Host $username -BackgroundColor White -ForegroundColor Black -NoNewline; Write-Host " is " -NoNewline; Write-Host $accexp.AccountExpires -BackgroundColor White -ForegroundColor Black | |
| # Get a new expiry | |
| $newexp = Read-Host "Enter new expiry" | |
| # Set the new expiry |
| Get-AppxProvisionedPackage -online | Where-Object {$_.packagename -like '*officehub*'} | Remove-AppxProvisionedPackage -online |
| <?php | |
| // Array given from 'api' | |
| $arr = array( | |
| "action: Added; quantity: 1; item_code: RNA1; product_name: Mens Organic T-Shirt; colour: White; size: XL;", | |
| "action: Subtracted; quantity: 7; item_code: RNC1; product_name: Kids Basic T-shirt; colour: Denim Blue; size: 3-4y", | |
| "action: Added; quantity: 20; item_code: RNV1; product_name: Gift Voucher; style: Mens; value: £20" | |
| ); | |
| // New array to hold the final output | |
| $newArr = array(); |
| # ---------------------------------------------------------------------- | |
| # | Cleaning URLs | | |
| # ---------------------------------------------------------------------- | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| # Remove www from URL's | |
| RewriteCond %{HTTP_HOST} ^www\.(.+) | |
| # RewriteCond %{HTTPS}s/%1 ^(on(s)|offs)/(.+) | |
| RewriteRule ^ http%2://%3%{REQUEST_URI} [L,R=301] |
| In console: | |
| git config credential.helper | |
| You will see: osxkeychain | |
| git config credential.helper sourcetree | |
| Then if you perform git config credential.helper again | |
| You will see: sourcetree |
| <?php | |
| return array( | |
| // Fix for MySQL 5.7.5+ and Craft 2.x | |
| 'initSQLs' => array("SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';") | |
| ); | |
| ?> |
| {# Get the destinations from an entry query #} | |
| {% set originalArrayQ = craft.entries().section("helloworld") %} | |
| {# Turn the query into an array of results #} | |
| {% set originalArray = originalArrayQ.all() %} | |
| {# Create an empty array #} | |
| {% set r = [] %} | |
| {# Loop through an x amount of count e.g. 0 to 3 (4 values) #} | |
| {% for item in 0..3 %} | |
| {# Merge into the array above a random value from the original array that isn't already in the random (r) array #} | |
| {% set r = r | merge([random(originalArray | filter(v => v not in r))]) %} |
| {# | |
| display the number 9 with 2 0's in front of it | |
| %'_3s would display the number 9 with 2 _ in front | |
| %'%10s with format("123") would display 123 with 7 % in fron of it | |
| % 3s would show 9 and 2 spaces in front | |
| %'_-3s would have 9 then 2 _ after it | |
| %'x-3s would have 2 x's after | |
| #} |