Jump to content

maxxd

Gurus
  • Posts

    1,652
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by maxxd

  1. It's been a few years since I used CodeIgniter, but it certainly looks like you're passing 15 parameters (one of which is a dynamic variable) to a method that accepts 2 parameters. If you try to dump anything other than $v_number or $v_reg from your save_records() method, what do you get?

  2. I don't know what RPi-3B is and I'm not a SysAdmin but I will say the if you're starting a new project with no skin in the game, go with PDO over MySQLi. It's much easier to work with and (I think) enabled by default. (I think.) Either way, I know it's easier to deal with while coding. mysqli is not a direct corollary to the removed mysql_* functions so no matter what you're going to have to refactor a good amount of code.

  3. I haven't used the SamKirkland/FTP-Deploy-Action action so I'm not sure exactly how it works, but it kinda looks like you're copying the files to the ftp server before you make the updates to the file. Use stream editor in your workflow steps to modify the .env, then place the modified files on the server.

    If you set up a .env.example file in the repo with a value like so:

    VERSION={{VERSION}}

    You'll be able to run this in your workflow (assuming VERSION is a variable in your repository):

    - run: |
    	cp .env.example .env
    	sed -i 's/{{VERSION}}/${{ vars.VERSION }}/g' .env

     

  4. You can always go old school and code your own with plain JS or jQuery at which point there really isn't a single "best practice" other than don't expose passwords, make sure you validate data, and never trust user input; however you'll be better off following requinix's advice and checking out the main three frameworks. I'll admit I find Vue easier than React and Angular, but that's just a personal opinion so your mileage may vary.

    Even using one of these, don't expose passwords, make sure you validate data, and never trust user input.

  5. Loading the URL helper is not the same as loading the view. Follow the link in my post.

    To be honest, it's not going to be easier. CI4 uses more modern techniques and coding practices so you'll have an easier time not only getting answers to specific questions (the CI4 boards on the forum as active), but you'll be able to google the techniques more generally.

  6. Where is $error output? I don't see the file `ffmpeg_submit.php` in the source for PHP-FFMpeg on GitHub so I assume it's something you've written. It could be  as simple as creating a different variable and outputting that instead of (or in addition to) the $error variable, but as we can't see your code there's no way for us to tell.

  7. I'll admit I personally am not a big fan of React - for whatever reason it doesn't sing to me. I have, however, found that Vue is not untenable from this crotchety old bastard's point of view insofaras a JavaScript framework is concerned if you're determined not to deal with vanilla JavaScript, fetch(), and writing the code yourself.

  8. If the OP is looking to find out if the numerical string is a palindrome, recursion isn't necessary. A palindrome is the same forward and backwards; use split(), reverse(), and join() on the input and compare it to the original string. However, the images of code in the first post have nothing to do with palindromes, they're all about something like the Fibonnacci sequence that requinix describes.

  9. I thought it might be loading order so I moved things around in my blade template, but that didn't seem to make a difference. Admittedly, I didn't know that console logging was lazy-loaded and I thought you had to specifically declare a script include as type="module" for it to be deferred without the `deferred` attribute being set but that all makes a ton of sense and it's a great place to start looking; gotta admit if it is as simple as wrapping everything in a loaded event I'm gonna be pretty red-faced while saying thanks!

  10. Hi y'all.

    I think I'm having a senior moment; I have the following code in `app.js`:

    import Swal from 'sweetalert2';
    window.Swal = Swal;

    `app.js` is included in my blade templates, where I have a partial that includes this code:

    <script>
    console.log(window);
    console.log(window.Swal);
    </script>

    My console output is attached to this post. Note that apparently nothing is attaching to the window object - even if it's just a simple `window.st = "testing";`, that reports undefined as well.

    js-issue.png

  11. This worked in my testing:

    let regexps = [
    	new RegExp('test', 'gi'),
    	new RegExp('another', 'gi'),
    	new RegExp('more', 'gi'),
    ];
    
    let entries = [
    	'More string',
    	'Second string',
    	'Super string',
    	'Basic string',
    ];
    
    // loop through the RegExps
    let res = regexps.map(re => {
    // then loop through the strings
    	return entries.map(itm => {
    		return re.test(itm);
    	})
    // flatten the resulting arrays and pipe that to some()
    }).flat().some(e => {
    	return e == true;
    });
    
    console.log(res);

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.