2020-04-13

MongoDB - Starts with string search

db.collection_name.find({ "field_name" : /^string_here/ });

2020-04-06

jQuery - Scroll to first element of a given class or selector

$('html, body').animate(
  {
    scrollTop: $('CSS_SELECTOR').first().offset().top
  }
  , 750
);

2020-02-23

MySQL - Split a string where substring is found

select 
   SUBSTRING_INDEX('part 1, part 2', ',', 1) as part_1
   , SUBSTRING_INDEX('part 1, part 2', ',', -1) as part_2
;

2020-01-26

Meteor - Server shell opening

(1) Open Terminal
(2) Navigate to your webapp root folder
(3) type "meteor shell"

2020-01-24

Python - Remove text punctuation

import string

table = string.maketrans("","")
text = "this is. a list; with some's punctuation... yes!"
result = text.translate(table, string.punctuation)
print(result)