Is it possible to convert an HTML <canvas> element to an SVG element?
Answers in Web Development | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:53 -0800
Last Reply
There are a number of javascript libraries that do this, take a look at this one:
https://github.com/canvg/canvg
Hash Brown,
There are a number of jav...
In JavaScript, how do you get the character pressed from a keydown function?
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:46 -0800
Last Reply
Super simple!
In pure Javascript:
<script type="text/javascript">
function theKeyPress(e){
var keynum;
if(window.event) {...
Hash Brown,
Super simple!
Can the "HTML Purifier" library be integrated into Laravel?
Answers in Frameworks | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:41:12 -0800
Last Reply
Yes!
They do a version of HTML Purifier specifically for Laravel
Read more here:
https://github.com/mewebstudio/Purifier
Hash Brown,
Yes!
[Laravel] Best way to determine an IP address' location?
Answers in Frameworks | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:42:03 -0800
Last Reply
You have a couple of possible options.
You can use an API like GeoIP.
There are people who have kindly coded laravel packages for this, her...
Hash Brown,
You have a couple of poss...
Best way to get a user's HTTP referer value within a Laravel project?
Answers in Frameworks | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:42:28 -0800
Last Reply
Here you go:
Request::server('HTTP_REFERER').
You should check the value is set before doing anything with it, not all requests have a referer...
Hash Brown,
Here you go:
Is Xenforo open source?
Answers in Web Development | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:47:42 -0800
Last Reply
Hello,
No, XenForo is a commercial software, you need to buy licenses and renew that license every year.
If you're looking for open source f...
Hash Brown,
Hello,
Is it possible to use PHP's in_array() function to only match exact results? For example, to match NULL but not FALSE?
Answers in Server-Side | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:48:33 -0800
Last Reply
Yes!
in_array() accepts 3 arguments, they are:
The string you're looking for.
The array you're searching.
"strict", whi...
Hash Brown,
Yes!
[PHP] How to print array values separated by commas?
Answers in Server-Side | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:43:17 -0800
Last Reply
<?php
implode(", ", $arr)
More Information: http://php.net/manual/en/function.implode.php
August R. Garcia,
[Laravel] How to get the largest ID for a table?
Answers in Frameworks | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:43:57 -0800
Last Reply
<?php
// Get max
$draft->draft_id = Post::max('id');
// Get the next after the max
$draft->draft_id = Post::max('id') + 1;
August R. Garcia,
[Google Sheets] How to get the largest number in a range?
Answers in Spreadsheets | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:44:15 -0800
Last Reply
See the MAX function:
https://support.google.com/docs/answer/3094013?hl=en
August R. Garcia,
See the MAX function:
How to trim dashes in PHP? Is there a function like trim() in PHP for non-whitespace?
Answers in Server-Side | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:44:44 -0800
Last Reply
The trim() function in PHP takes an optional second parameter:
http://php.net/manual/en/function.trim.php
This function should do what you...
August R. Garcia,
The trim() function in PH...
[CSS] Create a fallback image for an iFrame that fails to load? How to make a background image fit to div?
Answers in Style and Layout | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:45:21 -0800
Last Reply
Something like this should work:
<style>
iframe#some_iframe {
width: 100%;
height: 400px;
background-size: 100% 100%;...
August R. Garcia,
Something like this shoul...
How to exit Vim? Not sure how to save and quit Vim...
Answers in Scripting and Automation | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:47:07 -0800
Last Reply
Press ESC to make sure you are in command mode (also known as normal mode)
Type a colon to open start writing a command (which will show up at th...
August R. Garcia,
How to make the CSS "overflow:scroll" property only show scrollbars when they're needed?
Answers in Style and Layout | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:40:33 -0800
Last Reply
Change "overflow: scroll;" to "overflow-y: auto;overflow-x: auto;"
August R. Garcia,
Change "overflow: sc...
Can you have a number in a MySQL DB name?
Answers in Databases | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:39:56 -0800
Last Reply
Yes, numbers in MySQL/MariaDB database names work fine. The 256 Kilobytes database, for example, is callled 420_smoke_weed.
August R. Garcia,
Yes, numbers in MySQL/Mar...
[Laravel Error Message] Dotenv values containing spaces must be surrounded by quotes.
Answers in Frameworks | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:39:37 -0800
Last Reply
Replace APP_NAME with whichever field you're editing:
Instead of:
APP_NAME=Some Name
Use:
APP_NAME="Some Name"...
August R. Garcia,
Replace APP_NAME with whi...
[PHP Error] Call to undefined function App\Http\Controllers\eregi_replace()
Answers in Server-Side | By Some Guy
Published 1 year agoTue, 04 Dec 2018 17:39:02 -0800
Last Reply
The function eregi_replace() has been replaced by preg_replace().
"Warning: This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7...
August R. Garcia,
The function eregi_replac...
Is using hyphens in a URL to separate words good practice?
Answers in Search Engine Optimization | By Some Guy
Published 1 year agoMon, 03 Dec 2018 22:10:02 -0800 | Last update 1 year agoTue, 04 Dec 2018 13:54:29 -0800
Last Reply
Hyphens are generally the optimal approach for separating words. They:
Make your URLs easier to parse, which helps bots understand the content o...
August R. Garcia,
Hyphens are generally the...
404 vs 410 - what should I use when trying to remove URLs?
Answers in Search Engine Optimization | By Some Guy
Published 1 year agoMon, 03 Dec 2018 22:34:32 -0800 | Last update 1 year agoTue, 04 Dec 2018 13:54:09 -0800
Last Reply
410 -- It indicates a permanent, deliberate removal.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410
Also, if the URL removal...
August R. Garcia,
410 -- It indicates a per...
How can I check if row a exists with Laravel?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:39 -0800 | Last update 1 year agoMon, 03 Dec 2018 14:56:02 -0800
Last Reply
It depends on what you want to do with the data.
If you just want to check if it exists:
if (User::where('username', '=', Input::get('username...
Hash Brown,
It depends on what you wa...
How to determine IP location without using an API?
Answers in Server-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:21 -0800 | Last update 1 year agoMon, 03 Dec 2018 06:16:36 -0800
Last Reply
For scalability you're probably better off asking for users permission and using HTML Geolocation and using the API as a fall back for those that...
Hash Brown,
For scalability you'r...
[CSS squiggle/squiggly selector] Tilde in CSS?
Answers in Style and Layout | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:32 -0800
Last Reply
This is called a "general sibling combinator".
The general sibling combinator selector is very similar to the adjacent sibling combinator...
Hash Brown,
This is called a "ge...
Best way to import JSON to Google Sheets?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:42:13 -0800 | Last update 1 year agoMon, 03 Dec 2018 06:18:01 -0800
Last Reply
Another option would be to convert the JSON to CSV using an online tool like this:
https://json-csv.com/
Hash Brown,
Another option would be t...
Google Sheets Gantt Chart Template
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:44:54 -0800 | Last update 1 year agoMon, 03 Dec 2018 16:04:14 -0800
Last Reply
Super useful, thank you!
Hash Brown,
Super useful, thank you!
What are Hamming and Levenshtein distance?
Answers in Scripting and Automation | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:43:22 -0800
Last Reply
Sure, let me help you at a basic level.
Both terms come from information theory, they are a string metric to evaluate two values and basically meas...
Hash Brown,
Sure, let me help you at...
Why is VLookup supposedly so useful in Google Sheets?
Answers in Spreadsheets | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:22 -0800 | Last update 1 year agoMon, 03 Dec 2018 06:30:34 -0800
Last Reply
It depends what you are trying to do in Google Sheets, if you don't need the function and never use it then I guess it's just another function...
Hash Brown,
It depends what you are t...
[PHP] Listing all the folders subfolders and files in a directory?
Answers in Scripting and Automation | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:33 -0800
Last Reply
There is a function called scandir.
<?php
$directory = '/path/to/directory';
scandir($directory);
?>
This will output your directory...
Hash Brown,
There is a function calle...
How to implement an algorithm to calculate Levenshtein distance in JavaScript?
Answers in Scripting and Automation | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:26 -0800 | Last update 1 year agoSun, 02 Dec 2018 12:28:46 -0800
Last Reply
Here you go:
function levenshteinDistance (str1, str2) {
if (!str1.length) return str2.length;
if (!str2.length) return str1.length;...
Hash Brown,
Here you go:
[Laravel] How to make a custom 404 page?
Answers in Frameworks | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:38 -0800
Last Reply
The easiest way is to create a file at:
/resources/views/errors/404.blade.php
Replace 404 with the HTTP code that you want to make a custom...
August R. Garcia,
The easiest way is to cre...
CKEditor replace by class
Answers in Client-Side | By Some Guy
Published 1 year agoSun, 02 Dec 2018 03:45:51 -0800
Last Reply
Yes, it can be done. Something along these lines works. Can remove the try/catch statement at your discretion.
try {
// Intialize CKEditor Ins...
August R. Garcia,
Yes, it can be done. Some...