Skip to content

Instantly share code, notes, and snippets.

View andreypelykh's full-sized avatar
🏠
Working from home

Andrey Pelykh andreypelykh

🏠
Working from home
View GitHub Profile
@andreypelykh
andreypelykh / extra-webpack.config.js
Created September 2, 2022 20:41
Exclude @ckeditor files from all existing rules
const { styles } = require('@ckeditor/ckeditor5-dev-utils');
const path = require('path');
module.exports = function (config) {
// Your existing rules (example)
config.module.rules.push(
{
test: /\.css$/,
use: [
{
@andreypelykh
andreypelykh / extra-webpack.config.js
Last active September 2, 2022 20:35
Webpack config exports a function
module.exports = function (config) {
// Your existing rules (example)
config.module.rules.push(
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
options: {
// `style-loader` options here...
@andreypelykh
andreypelykh / extra-webpack.config.js
Last active September 2, 2022 20:36
Webpack config exports an object
const { styles } = require('@ckeditor/ckeditor5-dev-utils');
module.exports = {
module: {
rules: [
// Your existing rules (example)
{
test: /\.css$/,
use: [
{
Error: ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
SyntaxError
(1:1) /Users/.../node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css Unknown word
> 1 | import api from "!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js";
| ^
2 | import content from "!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--20-2!./code.css";
3 |
@andreypelykh
andreypelykh / _mixins.sass
Created February 27, 2018 10:32
sass mixins
=font-fallback($font)
font-family: $font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
$xl-width: 1200px;
$lg-width: 992px;
$md-width: 768px;
$sm-width: 576px;
=xl
@andreypelykh
andreypelykh / gist:75e9b99f0f7cef7cf99692b1d2a19c93
Created September 20, 2017 10:35
convert keywords to jasvascript array
const str: string;
str.split(',').map(e=> `'${e.trim()}'`).join(', ')
@andreypelykh
andreypelykh / social-colors.sass
Created July 8, 2017 21:13
Social sites colors
/* SASS / Social Media Brand Colors */
$twitter: #00aced;
$facebook: #3b5998;
$googleplus: #dd4b39;
$pinterest: #cb2027;
$linkedin: #007bb6;
$youtube: #bb0000;
$vimeo: #1ab7ea;
$tumblr: #32506d;
@andreypelykh
andreypelykh / gist:f34898feb9cbc72343f2ef9d48c8d948
Created March 25, 2017 19:42
show name of selected file good variant
$( '.fileContainer [type=file]' ).on( 'change', function updateFileName( event ){
var $input = $( this );
$input.parent().next('.fileName').text( $input.val().replace(/([^\\]*\\)*/,'') )
} );
$( '.fileContainer [type=file]' ).on( 'click', function updateFileName( event ){
var $input = $( this );
setTimeout( function delayResolution(){
$input.parent().text( $input.val().replace(/([^\\]*\\)*/,'') )
}, 0 )
} );
@andreypelykh
andreypelykh / style.css
Created March 12, 2016 17:24
css padding hack
.wrapper {
width: 100px;
margin: 0 auto;
}
.box {
background: goldenrod;
margin-left: auto;
margin-right: auto;
padding-top: 50%;