[MySQL] SELECT LIKE statement that ignores case?
Answers in Databases | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:48 -0800
Last Reply
Yes, it's possible. Here are two options:
SELECT * FROM `some_table` WHERE some_field COLLATE UTF8_GENERAL_CI LIKE '%some string%';
SELECT...
August R. Garcia,
Yes, it's possible. H...
What is the best way to find where base functions/models are defined in Laravel? Where is this code even located?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:47 -0800
Last Reply
Models and functions from the base Laravel code should be located in a subdirectory of the 'vendor' folder. Using the Linux terminal to recu...
August R. Garcia,
Models and functions from...
Laravel Validation - What is the best way to create a whitelist to allow only certain HTML tags?
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:46 -0800
Last Reply
Have seen a number of people recommend HTML Purifier:http://htmlpurifier.org/You might also look into PHP's strip_tags() function:http://php.net/...
August R. Garcia,
Have seen a number of peo...
How to get word count of a cell using Google Sheets?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:44 -0800
Last Reply
Can be done with:=COUNTA(SPLIT(A2, " "))https://www.techjunkie.com/word-count-google-sheets/Seems to returns 1 on empty cells -- adjustment...
August R. Garcia,
Can be done with:=COUNTA(...
[Laravel] If not on a certain page redirect to that page?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:43 -0800
Last Reply
Something along these lines should work for your purposes:if (Request::path() != "posts/some-post") return redirect('/posts/some-post&...
August R. Garcia,
Something along these lin...
[PHP]/JS] Pass a PHP array to a JavaScript function?
Answers in Server-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:42 -0800
Last Reply
The json_encode() function can do this. Ex:<script> insert_chart( 'pie_users_by_account_type' , <?= json_encode($arr); ?>, ...
August R. Garcia,
The json_encode() functio...
What is the default font family in HTML?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:40 -0800
Last Reply
It depends on the browser that you're using.More information:https://www.granneman.com/webdev/coding/css/fonts-and-formatting/web-browser-font-de...
August R. Garcia,
It depends on the browser...
When will HTML6 and/or CSS4 be announced?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:38 -0800
Last Reply
The answer is "In a long time or possibly never." The standards are more likely to be incrementally updated. Web development standards and t...
August R. Garcia,
The answer is "In a...
In web.PHP line 23: The use statement with non-compound name 'Request' has no effect
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:36 -0800 | Last update 1 year agoMon, 03 Dec 2018 05:16:39 -0800
Last Reply
This is a bug that I ran into while testing a few things in the routes/web.PHP file. I had included the line:
<?php
use Request;
While--...
August R. Garcia,
This is a bug that I ran...
How to set up a Favicon for a site that uses Laravel?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:34 -0800
Last Reply
This post covers how to set a favicon in Laravel:
http://blog.stickyrice.net/archives/2014/how-to-change-your-laravel-site-favicon/
You mi...
August R. Garcia,
This post covers how to s...
How to get the first 20 words from a string in Laravel?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:31 -0800
Last Reply
The function you're looking for is str_limit().
https://Laravel-news.com/str_limit
https://Laravel.com/docs/5.7/helpers#method-str-limit...
August R. Garcia,
The function you're l...
[CSS Question] Can you ignore border size to prevent the border from making the element larger?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:29 -0800
Last Reply
This is likely/generally related to the box-sizing property. One way to handle this is to make a CSS class like the following:
.box-border-fix {...
August R. Garcia,
This is likely/generally...
How to check "if classlist contains" using JavaScript
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:27 -0800
Last Reply
var c_menus = document.getElementsByClassName("c_menu");for (var iii = 0; iii < c_menu.length; ++iii) { c_menu[iii].addEventListe...
August R. Garcia,
var c_menus = document.ge...
Does PHP have a shorthand for IF statements?
Answers in Server-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:26 -0800
Last Reply
Yes. Example:
<?php
$t = ($user->is_staff) ? $user->name : FALSE;
Should be covered in the PHP documentation:
http://PHP.net/...
August R. Garcia,
Yes. Example:
[Halp] Remove non-alphanumeric in Google Sheets?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:22 -0800
Last Reply
// Remove non-alphanumeric
=REGEXREPLACE(lower(E2), "[^A-Za-z0-9]", "")
// Replace non-alphanumeric with a space
=REGEXREPLACE(lower(E2), "[^A-...
August R. Garcia,
What is the difference between Bootstrap 3 and Bootstrap 4?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:21 -0800
Last Reply
Should be covered in the patch notes:
http://blog.getbootstrap.com/2018/01/18/bootstrap-4/
Also, there are separate Bootstrap 3 and Bootst...
August R. Garcia,
Should be covered in the...
[CKEditor] Input validation?
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:17 -0800
Last Reply
Input validation through CKEditor is limited to the client-side, which means that the actual validation would occur on the server-side through PHP/Lar...
August R. Garcia,
Input validation through...
[CSS] How to pin a button/badge to corners of a div?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:15 -0800
Last Reply
Here is one option:* Give the parent div the pin-board class* Give the badge/button the pin class* Combine the top, right, bottom, and left classes to...
August R. Garcia,
Here is one option:* Give...
Should a CSS class have a dot or hash sign?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:13 -0800
Last Reply
The hash symbol is used to refer to the id property. Dots are used to refer to classes. In general, you want to use classes when applying styles.<s...
August R. Garcia,
The hash symbol is used t...
[Laravel] Get current date and time in a way that is human redable?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:09 -0800
Last Reply
The diffForHumans function is a function of the Carbon library, rather than part of Laravel itself. To get the current date and time in a similar huma...
August R. Garcia,
The diffForHumans functio...
Why is it called DuckDuckGo?
Answers in Garbage Can | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:08 -0800
Last Reply
For reasons:> He said of the origin of the name: "Really it just popped in my head one day and I just liked it. It is certainly influenced/der...
August R. Garcia,
For reasons:> He said...
[Google Sheets] How to generate possible email addresses based on a first and last name?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:06 -0800
Last Reply
Something like this should work:# "First Last" --> Email=REGEXREPLACE(lower(A1)&RANDBETWEEN(1,999), "([^A-Za-z0-9]+)", &quo...
August R. Garcia,
Something like this shoul...
Where is the base model class located for a Laravel installation?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:04 -0800
Last Reply
The base class for Model objects is located at this path:vendor/Laravel/framework/src/Illuminate/Database/Eloquent/ModelAt the top of the child class...
August R. Garcia,
The base class for Model...
[JavaScript/Google Apps Script] Remove newlines in a Script Editor function?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:03 -0800 | Last update 1 year agoSun, 02 Dec 2018 12:55:36 -0800
Last Reply
The script editor is essentially the same as JavaScript. This line should work for most cases:
t = t.replace(/ /gm,"");
August R. Garcia,
The script editor is esse...
Can you unset a variable in PHP?
Answers in Server-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:02 -0800 | Last update 1 year agoSun, 02 Dec 2018 13:27:57 -0800
Last Reply
Yes, you can unset a variable. The PHP function is actually called unset:
http://PHP.net/manual/en/function.unset.PHP
August R. Garcia,
Yes, you can unset a vari...
Connect Web FTP Dreamhost
Answers in Web Hosting | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:00 -0800 | Last update 1 year agoMon, 03 Dec 2018 05:24:24 -0800
Last Reply
You could build your own Web FTP client in the time it takes to figure out the correct login credentials.
August R. Garcia,
You could build your own...
How to get random pivot table values with Laravel seeders?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:59 -0800 | Last update 1 year agoMon, 03 Dec 2018 05:26:57 -0800
Last Reply
The 'sync' method solves for the issue with duplicates causing errors. A piece of code similar to this is relatively concise and works for gen...
August R. Garcia,
The 'sync' method...
Is it possible to have the pagination generated in a Laravel controller link to an anchor?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:57 -0800 | Last update 1 year agoMon, 03 Dec 2018 05:28:57 -0800
Last Reply
The 'fragment' method allows for an anchor to be specified. A function along these lines should work:
<?php
public function show($id)...
August R. Garcia,
The 'fragment' me...
[JavaScript] addEventListener to all in array?
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:56 -0800 | Last update 1 year agoSun, 02 Dec 2018 12:36:38 -0800
Last Reply
Use this instead of a static variable.
for (iii = 0; iii < arr.length; ++iii)
arr[iii].addEventListener("click", function(e) { this....
August R. Garcia,
Use this instead of...
Laravel - Where to store utility functions?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:50 -0800
Last Reply
If you're writing utility functions that are used for all/many of your controlelrs, you might consider defining them in the/a parent controller&#...
August R. Garcia,
If you're writing ut...