Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
;-)

Yurii De dejurin

💭
;-)
  • Si-ɑR
  • 127.0.0.1
View GitHub Profile
@dejurin
dejurin / install.md
Created Jun 9, 2022 — forked from Herz3h/install.md
Locales alpine 3.9
View install.md

Copy locale.md file below into same directory as your Dockerfile

FROM alpine:3.9

# Install language pack
RUN apk --no-cache add ca-certificates wget && \
    wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
 wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
@dejurin
dejurin / truncate.css
Created Jun 5, 2022 — forked from elky/truncate.css
text-overflow ellipsis with 100% width
View truncate.css
/*
Demo: https://jsfiddle.net/elky/f6khaf2t/
<div class="element">
<div class="truncate">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
View Classifies.txt
/Adult
/Arts & Entertainment
/Arts & Entertainment/Celebrities & Entertainment News
/Arts & Entertainment/Comics & Animation
/Arts & Entertainment/Comics & Animation/Anime & Manga
/Arts & Entertainment/Comics & Animation/Cartoons
/Arts & Entertainment/Comics & Animation/Comics
/Arts & Entertainment/Entertainment Industry
/Arts & Entertainment/Entertainment Industry/Film & TV Industry
/Arts & Entertainment/Entertainment Industry/Recording Industry
@dejurin
dejurin / docker-compose.yml
Created Apr 22, 2022
How to Deploy Wordpress with Docker (WordPress/MariaDB/Adminer)
View docker-compose.yml
version: "3.9"
services:
db:
image: mariadb:latest
platform: linux/amd64
volumes:
- ./db_data:/var/lib/mysql
restart: always
environment:
MYSQL_TCP_PORT: 3310
@dejurin
dejurin / start_end_day.py
Last active Feb 18, 2022
Get start and end points for: week, month, quarter and year
View start_end_day.py
from datetime import date
from dateutil.relativedelta import relativedelta
def start_end_day(sunmon: bool = True):
today = date.today()
curr_quarter = int((today.month - 1) / 3 + 1)
dayofweek = [today.weekday(),today.isoweekday()][sunmon]
week_start = today - relativedelta(days=dayofweek)
@dejurin
dejurin / mysq-mariadb-macos-start-issue.md
Created Dec 3, 2021 — forked from irazasyed/mysq-mariadb-macos-start-issue.md
Solution for MySQL / MariaDB Start Issue on MacOS
View mysq-mariadb-macos-start-issue.md

Solution for MySQL / MariaDB Start Issue on MacOS

Errors

On trying to start mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (12262) - No such process ERROR!

@dejurin
dejurin / url_path_for.py
Last active Oct 17, 2021
Starlette Jinja2Templates add relative URL (url_path_for)
View url_path_for.py
#Add to class Jinja2Templates:
#https://github.com/encode/starlette/blob/6c556f6c5e4aa70173a84f6e6854390241231021/starlette/templating.py
@jinja2.contextfunction
def url_path_for(context: dict, name: str, **path_params: typing.Any) -> str:
request = context["request"]
router = request.scope["router"]
return router.url_path_for(name, **path_params)
env.globals["url_path_for"] = url_path_for
@dejurin
dejurin / jsInputFilter.html
Last active Oct 1, 2021
JavaScript input filter showcase
View jsInputFilter.html
<!-- https://jsfiddle.net/user/emkey08 -->
<!-- https://jsfiddle.net/emkey08/zgvtjc51 -->
<h2>JavaScript input filter showcase</h2>
<p>Supports Copy+Paste, Drag+Drop, keyboard shortcuts, context menu operations, non-typeable keys, the caret position, different keyboard layouts, and <a href="https://caniuse.com/#feat=input-event" target="_blank">all browsers since IE 9</a>.</p>
<p>There is also a <a href="https://jsfiddle.net/emkey08/tvx5e7q3" target="_blank">jQuery version</a> of this.</p>
<table>
<tr><td>Integer</td><td><input id="intTextBox"></td></tr>
<tr><td>Integer &gt;= 0</td><td><input id="uintTextBox"></td></tr>
<tr><td>Integer &gt;= 0 and &lt;= 500</td><td><input id="intLimitTextBox"></td></tr>
@dejurin
dejurin / meta-tags.md
Created Sep 27, 2021 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags
View meta-tags.md
@dejurin
dejurin / isElementInViewport.js
Created Sep 7, 2021 — forked from davidtheclark/isElementInViewport.js
JavaScript: Is element in viewport?
View isElementInViewport.js
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&