Skip to content

Instantly share code, notes, and snippets.

View Peter-Hudson's full-sized avatar
🎯
Focusing

Peter Hudson Peter-Hudson

🎯
Focusing
View GitHub Profile
@Peter-Hudson
Peter-Hudson / RegEx
Last active April 12, 2019 07:31
There has to be a better version of this? Though I did this without searching the answer.
let testString = 'aaabbbbaa';
testString.match(/.+?(a+|b+|c+|d+|e+|f+|g+|h|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+)/igm).map(c => c.length + c[1]).join('');
@Peter-Hudson
Peter-Hudson / updated bash?
Created November 8, 2016 14:42
updated bash?
. !$
@Peter-Hudson
Peter-Hudson / MySQL load infile CSV.md
Last active September 30, 2015 11:19
Testing the import of a CSV file into MySQL

mysql -utest -p test --local-infile

CREATE TEMPORARY TABLE IF NOT EXISTS `tempy` (
    `tempy_id` INT(21) AUTO_INCREMENT,
    `tempy_value` INT(21) DEFAULT NULL,
    PRIMARY KEY (`tempy_id`)
)ENGINE = InnoDB;

LOAD DATA LOCAL INFILE 'test.csv' INTO TABLE `tempy`