Skip to content

Instantly share code, notes, and snippets.

@santarinto
santarinto / example.html
Created March 15, 2021 16:36 — forked from zserge/example.html
This is the smallest possible CSS-in-JS that supports all CSS rules, media queries, keyframes and generates unique class names for each CSS block. Can be used with React or with any other framework.
<body>
<script type="module">
import { css } from './zercss.js';
// Global styles
css`
&{} /* This would be a global CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { max-width: 40rem; padding: 2rem; margin: auto; }
`;
@santarinto
santarinto / .gitconfig
Created February 24, 2021 16:35 — forked from XilefNori/.gitconfig
gitconfig
[user]
# name = yourname
# email = [email protected]
[merge]
tool = vimdiff
[mergetool]
keeptemporaries = false
keepbackups = false
# Container lifecycle
alias dps='docker ps'
alias dpsa='docker ps -a'
alias dip='docker inspect --format "{{ .NetworkSettings.IPAddress }}" '
alias dstop='docker stop $(docker ps -a -q)'
alias drm='docker rm $(docker ps -a -q)'
dshell ()
{
(docker exec -ti $1 bash) || (docker exec -ti $1 sh);
@santarinto
santarinto / .gitignore
Created December 26, 2020 11:24
.gitignore for jetbrains ides with saves dictionary and fix styles
###> idea dictionaries ###
.idea/*
!.idea/inspectionProfiles/
!.idea/dictionaries/
###< idea dictionaries ###
1: 01-02-0010
2: 01-02-0021
3: 01-02-0027
4: 01-02-0038
5: 01-02-0049
6: 01-02-0055
7: 01-02-0066
8: 01-02-0077
9: 01-02-0083
10: 01-02-0094
@santarinto
santarinto / t1.php
Created December 6, 2020 13:55
average ideal ferrary
<?php
$date = new DateTime('0001-01-01');
$now = new DateTime('2022-01-01');
$count = 0;
while ($date < $now) {
$isSuitable = false;
if ((int)$date->format('m') === 2) {
@santarinto
santarinto / Makefile
Created December 5, 2020 19:52
Default Makefile woth help tasks
# Get from https://diamantidis.github.io/tips/2020/07/01/list-makefile-targets
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sed -n 's/^\(.*\): \(.*\)##\(.*\)/\1\3/p' \
| column -t -s ' '
install: ## Install
@santarinto
santarinto / ffi1.php
Last active November 26, 2020 17:43
ffi1.php
<?php
//language=cpp
$headers = <<<'cpp'
int MessageBoxA(void* hwnd, const char* lpText, const char* lpCaption, unsigned int uType);
cpp;
$ffi = \FFI::cdef($headers, 'User32.dll');
$ffi->MessageBoxA(null, 'title', 'descr', 0);
struct uzel {
uzel* child1;
uzel* child2;
uzel* parent;
}
function procesedTree(uzel* node) {
if (node->child1 != NULL) processedTree(node->child1);
if (node->child2 != NULL) processedTree(node->child2);
@santarinto
santarinto / phpStormClearCodeceptionReports.js
Created August 19, 2019 07:22
Jetbrains PhpStorm clear codeception reports tool js
function ReportTool () {}
ReportTool.prototype.removeAllSuccessParts = () => {
const sList = document.getElementById('status_list');
Array.prototype.forEach.call(sList.childNodes, (c) => {
if (c.tagName !== 'LI') return;
if (!c.classList.contains('failed')) sList.removeChild(c);
});
}