Skip to content

Instantly share code, notes, and snippets.

View DyadicGit's full-sized avatar

Olgerd Ševiakov DyadicGit

  • Lithuania
View GitHub Profile
@DyadicGit
DyadicGit / MainActivity.java
Created January 7, 2021 14:00 — forked from creotiv/MainActivity.java
ReactNative permission model fix for Android
package com.example.app;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
@DyadicGit
DyadicGit / PurgeCss in Create React App without ejecting
Last active February 23, 2023 21:38
remove unused css (PurgeCss) in Create React App without ejecting
//package.json
{
...
"devDependencies": {
...
"purgecss": "^3.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && npm run purge-css",
@DyadicGit
DyadicGit / basic nodejs server.js
Last active July 2, 2020 08:25
basic node.js server with GET endpoints & without express
const https = require('https');
callback = returnFn => response => {
let str = '';
response.on('data', chunk => {
str += chunk;
});
response.on('end', () => {
returnFn(str);
});
@DyadicGit
DyadicGit / Trie JS
Last active October 28, 2020 08:59
Trie in JS/Typescript with data storing, used for fast searching
class TrieNode {
constructor(key) {
this.key = key
this.parent = null
this.children = {}
this.end = false
}
getWord() {
const output = [];
let node = this;
@DyadicGit
DyadicGit / mixins.scss
Created February 5, 2020 09:54
IE 11 - CSS Grid - SASS mixins
// Ensure CSS grid works with IE 11 spec.
// https://css-tricks.com/browser-compatibility-css-grid-layouts-simple-sass-mixins/
// sass-lint:disable no-vendor-prefixes, no-duplicate-properties
@mixin display-grid {
display: -ms-grid;
display: grid;
}
// $columns values should be delimited by a space
@mixin grid-template-columns($columns...) {