Skip to content

Instantly share code, notes, and snippets.

View devzom's full-sized avatar
:octocat:
Coding for life and fun

Jakub Zomerfeld devzom

:octocat:
Coding for life and fun
View GitHub Profile
@devzom
devzom / AdbCommands
Created March 21, 2019 09:54 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@devzom
devzom / DartBasicsTest.dart
Created March 29, 2020 10:08
Testing Dart basics
//////////// 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 August 28, 2020 17:18
MySQL: Generate slug from ex. name
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 October 9, 2020 06:03
GULP: Basic configuration for GULP 4
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 October 15, 2020 08:46
JS: set pseudo element content :before OR :active
/*
* 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 October 20, 2020 10:50 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#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 November 17, 2020 14:59
CSS: debugging -> debug attribute for html element with overlays
/*! 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 December 1, 2020 10:43
webpack: itterate image files inside a assets folder (ex. Vue)
/*
#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 December 2, 2020 12:27 — forked from Tuarisa/nuxt-axios-cache.js
Nuxt axios cache plugin
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 March 10, 2021 12:46
// Bug Magnet exploratory testing plugin Chrome/Firefox configuration for additional menu
{
"Polish numbers": {
"Correct": "504324123",
"Correct +": "+48 722 833 444",
"Incorrect": "23232323",
"Zeros":"000 000 000",
"Zero +":"000 444 222"
}
}