Tested on Windows 10 & Ubuntu 16.
- Check that sshd on Ubuntu is properly configured
| PHPStorm Regex Convert Array to Object Syntax | |
| If you are converting some code from using array syntax to object property syntax then you might like this little snippet of regex. | |
| This is design to paste straight into the find/replace dialogue in PHPStorm | |
| Find: | |
| \$(\w+)\['([^']+)'\] | |
| Replace: |
| Do you keep modifiying $my_variable->foo to $my_variable['foo'] over and over everyday? This regex is for you. | |
| text to replace : (\$some_variable)(\->)([\w]+) | |
| replacement : $1\[\'$3\'\] | |
| Backup your files to prevent any problems. Use this with caution. At your own risk. | |
| Usage: | |
| 1. Keyboard shortcut Cmd + R or equivalent to trigger a text replace | |
| 2. Click on the regex checkbox |
| <html> | |
| <head> | |
| <title>Checkbox</title> | |
| <style> | |
| input[type=checkbox] { | |
| display:none; | |
| } | |
| input[type=checkbox] + label | |
| { |
| #!/bin/sh | |
| ## backup each mysql db into a different file, rather than one big file | |
| ## as with --all-databases. This will make restores easier. | |
| ## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
| ## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
| ## Create the user and directories | |
| # mkdir -p /var/backups/mysql/databases | |
| # useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
| ## Remember to make the script executable, and unreadable by others |
| if ($request_uri = /) { | |
| set $test A; | |
| } | |
| if ($host ~* teambox.com) { | |
| set $test "${test}B"; | |
| } | |
| if ($http_cookie !~* "auth_token") { | |
| set $test "${test}C"; |
| /* Produces a dump on the state of WordPress when a not found error occurs */ | |
| /* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */ | |
| ini_set( 'error_reporting', -1 ); | |
| ini_set( 'display_errors', 'On' ); | |
| echo '<pre>'; | |
| add_action( 'parse_request', 'debug_404_rewrite_dump' ); | |
| function debug_404_rewrite_dump( &$wp ) { |
| // simple jquery tinymce lazyload | |
| // - using $.getScript alone will not work | |
| // - it's important to set the tinymce basepath, and set the domLoaded attribute | |
| window.tinyMCEPreInit = { | |
| base: '/js/tiny_mce/', | |
| suffix : '', | |
| query : '' | |
| }; | |
| $(function(){ |
| { | |
| "491289025" : "ijinshan-kappmarket://", | |
| "301521403" : "fb103361823069955://", | |
| "492178411" : "ils492178411://", | |
| "346142396" : "fb234434003713://", | |
| "310633997" : "whatsapp://", | |
| "370614765" : "com.condenet.newyorker://", | |
| "325058491" : "rnmddisco://", | |
| "382952264" : "epichttp://", | |
| "477048487" : "predictwind://", |