- Open
.git/config
file. - Add
autocrlf = false
andsafecrlf = true
to[core]
section. - Save the file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.datetime { | |
position: relative; | |
width: 158px; | |
height: 38px; | |
color: white; | |
} | |
input.datetime:before { | |
position: absolute; | |
top: 8px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { useMousePosition } from "~/hooks/useMousePosition"; | |
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
const [mouseX, mouseY] = useMousePosition(); | |
const positions = { x, y, h, w, mouseX, mouseY }; | |
return ( | |
<div |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Query to convert table and all its column type to utf8 | |
ALTER TABLE <Table_Name> CONVERT TO CHARACTER SET utf8; | |
-- Query to generate Alter Table for all tables | |
SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA, '.', TABLE_NAME," CONVERT TO CHARACTER SET utf8;") AS ExecuteTheString | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA="<Database_Name>" | |
AND TABLE_TYPE="BASE TABLE"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// ES 5 | |
function onlyUnique(value, index, self) { | |
return self.indexOf(value) === index; | |
} | |
// usage example: | |
var a = ['a', 1, 'a', 2, '1']; | |
var unique = a.filter(onlyUnique); | |
console.log(unique); // ['a', 1, 2, '1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* preventCopy() | |
* Prevents user from copying the text from form fields, either by copy/cut or dragging and dropping text. | |
* Binds preventDefault() to oncopy and oncut events. | |
* Binds event that makes all fields in selector readonly for onmousedown event. (Doesn't make target field readonly.) | |
* Binds event that removes readonly for onmouseup event. | |
* MSIE bug requires a user to click twice after readonly has been removed. Focus() doesn't work, use select(). | |
* I specifically allowed pasting because the issue is really the copying. | |
* @param selector string required - jQuery selector for form field(s). As allowed by jQuery, this is typically a list of selectors in one string. | |
* @return void | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dates=[]; | |
dates.push(new Date("2011/06/25")); | |
dates.push(new Date("2011/06/26")); | |
dates.push(new Date("2011/06/27")); | |
dates.push(new Date("2011/06/28")); | |
var maxDate=new Date(Math.max.apply(null,dates)); | |
var minDate=new Date(Math.min.apply(null,dates)); |
Attention Wamp/Wordpress/windows users. I had this issue for hours and not even the correct answer was doing it for me, because I was editing the wrong php.ini file because the question was answered to XAMPP and not for WAMP users, even though the question was for WAMP.
here's what I did
Download the certificate bundle.
Put it inside of C:\wamp64\bin\php\your php version\extras\ssl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gomakethings.com/check-if-two-arrays-or-objects-are-equal-with-javascript/ | |
var isEqual = function (value, other) { | |
// Get the value type | |
var type = Object.prototype.toString.call(value); | |
// If the two objects are not the same type, return false | |
if (type !== Object.prototype.toString.call(other)) return false; | |
// If items are not an object or array, return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Something likes find_in_set('a,b,c', 'a,b,c,d') | |
We can use OR: | |
find_in_set('a', 'a,b,c,d') OR find_in_set('b', 'a,b,c,d') OR find_in_set('b', 'a,b,c,d') | |
*/ | |
WHERE CONCAT(",", `setcolumn`, ",") REGEXP ",(val1|val2|val3)," |
NewerOlder