View .htaccess
## ================== | |
## Maintenance Mode = | |
## ================== | |
## Single Day | |
## RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY} 20200101 | |
## RewriteCond %{TIME_HOUR}%{TIME_MIN} >1200 | |
## RewriteCond %{TIME_HOUR}%{TIME_MIN} <1300 | |
## Multiple Days | |
RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN} >202001011300 | |
RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN} <202001021300 |
View Now Playing.ahk
#Persistent | |
#SingleInstance, Force | |
#NoEnv | |
If ProcessExist("wmplayer.exe") | |
wmp := new RemoteWMP | |
!4:: ; Alt+4 | |
SpeakAloudTrack(wmp) | |
Return |
View bluetooth.ps
[CmdletBinding()] Param ( | |
[Parameter()][ValidateSet('On', 'Off')][string]$BluetoothStatus | |
) | |
If ((Get-Service bthserv).Status -eq 'Stopped') { Start-Service bthserv } | |
Add-Type -AssemblyName System.Runtime.WindowsRuntime | |
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] | |
Function Await($WinRtTask, $ResultType) { | |
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType) | |
$netTask = $asTask.Invoke($null, @($WinRtTask)) | |
$netTask.Wait(-1) | Out-Null |
View mp3tag.txt
// Tag → Filename | |
$replace($caps(%artist%),', ', & ,Ft,feat.,Vs,vs.) - ''$caps($replace($lower($replace(%title%,'',’)''),' (original mix)',,extended ,, mix, remix,' (',''' (','(','[',')',']',']''',']',' [mix]',,' [remix]',),''' [') |
View datatables.paging.js
$.fn.DataTable.ext.pager.numbersWithEllipses = function (page, pages) { | |
if (pages === 1) { | |
return []; | |
} | |
var numbers = [], | |
buttons = 3, | |
withEllipses = true; | |
var range = function (len, start) { |
View questions.txt
GEOGRAPHY | |
1. Which US state has the longest coastline? (Alaska) | |
2. How many timezones are there in China? (1) | |
3. What is the capital of Switzerland? (Bern) | |
4. What is the largest island in the world? (Greenland) | |
5. Which country is the largest producer of coffee? (Brazil) | |
6. What is the national sport of Canada? (Lacrosse) | |
7. What country spans all four hemispheres? (Kiribati) | |
8. What is the most northerly capital city in the world? (Reykjavik) | |
9. What country has three capital cities? (South Africa) |
View string-differences.php
<?php | |
/** | |
* Generate two arrays: | |
* Values array: a list of elements as they appear in the diff | |
* Mask array: 0: unchanged, -1: removed, 1: added | |
* | |
* @param string $from | |
* @param string $to | |
* @return array |
View rector-codeigniter.yml
# rector process application --config=rector-codeigniter.yml | |
parameters: | |
import_short_classes: false | |
php_version_features: '5.6' #'7.3' | |
autoload_paths: | |
- '..\composer_plugins\autoload.php' # '..\vendor\autoload.php' | |
- 'system\core' | |
- 'system\libraries' | |
- 'application\core' | |
- 'application\controllers' |
View shadows.scss
// https://next.tailwindcss.com/docs/box-shadow/ | |
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06) } | |
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06) } | |
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05) } | |
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04) } | |
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25) } |
View image.bat
for %I in (*.svg) do convert -density 1536 -background none "%I" ( -clone 0 -background #989898 -shadow 80x3+5+5 ) -reverse -background none -resize 120x120 -gravity center -extent 192x192 -layers merge +repage "%~nI.png" | |
for %I in (*.svg) do outline-stroke "%I" -o "%I" | |
for %I in (*.svg) do svgo "%I" |
NewerOlder