Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding for life and fun

Jakub Zomerfeld devzom

:octocat:
Coding for life and fun
View GitHub Profile
@devzom
devzom / AdbCommands
Created Mar 21, 2019 — forked from Pulimet/AdbCommands
Adb useful commands list
View AdbCommands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@devzom
devzom / DartBasicsTest.dart
Created Mar 29, 2020
Testing Dart basics
View DartBasicsTest.dart
//////////// abstract classes, interfaces, mixins
enum TeacherType { mathematican, biologist, physics }
abstract class Person {
TeacherType teacherType;
void teach();
}
mixin Language {
@devzom
devzom / MySQL: Generate slug from ex. name.txt
Last active Aug 28, 2020
MySQL: Generate slug from ex. name
View MySQL: Generate slug from ex. name.txt
A slug is a short name using human-readable keywords to identify a web page. For example, in the following URL
http://www.example.com/schools/new-york-art-school
the slug is new-york-art-school. This post shows how to automatically generate slug using SQL in MySQL.
Suppose we have a table schools a field name, and we wish to generate a slug for each school using the name. First, add one field for the slug.
@devzom
devzom / basic_gulp4.js
Created Oct 9, 2020
GULP: Basic configuration for GULP 4
View basic_gulp4.js
const {src, dest, watch, series, parallel} = require('gulp'); //ES destructuring assignment
var sass = require("gulp-sass"),
autoPrefixer = require("gulp-autoprefixer"),
minifyCss = require("gulp-clean-css"),
rename = require("gulp-rename"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
plumber = require("gulp-plumber"),
util = require("gulp-util"),
@devzom
devzom / JS-setPseudoElementContent.js
Last active Oct 15, 2020
JS: set pseudo element content :before OR :active
View JS-setPseudoElementContent.js
/*
* github.com/devzom / Jakub Zomerfeld
* * (c) 15 / 10 / 2020
* Function for setting an pseudo element property :after / :before
*/
//
// ES6<
function setPseudoElementContent(selector, value) {
document.styleSheets[0].addRule(selector, 'content: "' + value + '";');
}
@devzom
devzom / .htaccess
Created Oct 20, 2020 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@devzom
devzom / debug.css
Last active Nov 17, 2020
CSS: debugging -> debug attribute for html element with overlays
View debug.css
/*! debug.css | MIT License |
Jakub Zomerfeld
/* Instruction:
just add an 'debug' attribute to main html element ex.
<div id="#app" debug>
</div>
*/
[debug], [debug] *:not(g):not(path) {
color: hsla(210, 100%, 100%, 0.9) !important;
@devzom
devzom / webpack-image-iterrate.js
Last active Dec 1, 2020
webpack: itterate image files inside a assets folder (ex. Vue)
View webpack-image-iterrate.js
/*
#You can utilize webpack's require.context() to list files in a given directory at compile time.
# https://webpack.js.org/guides/dependency-management/
*/
const illustrations = require.context(
'@/assets/illustrations',
true,
/^.*\.jpg$/
)
@devzom
devzom / nuxt-axios-cache.js
Created Dec 2, 2020 — forked from Tuarisa/nuxt-axios-cache.js
Nuxt axios cache plugin
View nuxt-axios-cache.js
import hash from 'object-hash'
import sizeof from 'object-sizeof'
import lruCache from 'lru-cache'
const cacheEnabled = true
const cacheMaxAge = 30 * 60 * 1000
const cacheMaxSize = 128 * 1000 * 1000
const getCacheKey = obj => hash(obj)
@devzom
devzom / Bug-Magnet.json
Last active Mar 10, 2021
// Bug Magnet exploratory testing plugin Chrome/Firefox configuration for additional menu
View Bug-Magnet.json
{
"Polish numbers": {
"Correct": "504324123",
"Correct +": "+48 722 833 444",
"Incorrect": "23232323",
"Zeros":"000 000 000",
"Zero +":"000 444 222"
}
}