Skip to content

Instantly share code, notes, and snippets.

View Woorg's full-sized avatar

Igor Gorlov Woorg

View GitHub Profile
'use strict';
// sudo npm i --save-dev gulp-group-css-media-queries autoprefixer-stylus gulp-cssnano gulp-watch gulp-autoprefixer gulp-uglify gulp-stylus gulp-rigger gulp-minify-css gulp-csscomb gulp-imagemin gulp-sourcemaps imagemin-pngquant gulp-plumber gulp-rename vinyl-buffer browser-sync gulp.spritesmith main-bower-files gulp-filter gulp-concat gulp-base64 gulp-svg-sprite
var isProduction = false;
var gulp = require('gulp'),
watch = require('gulp-watch'),
autoprefixer = require('autoprefixer-stylus'),
uglify = require('gulp-uglify'),
[target=_blank][rel=noopener noreferrer]
@Woorg
Woorg / gist:6a9b68005d8c9686af51de61089f047d
Created November 24, 2016 13:30
click outside jquery
(function(jQuery) {
jQuery.fn.clickoutside = function(callback) {
var outside = 1, self = $(this);
self.cb = callback;
this.click(function() {
outside = 0;
});
$(document).click(function() {
outside && self.cb();
outside = 1;
line-height (1.3em + (1.5 - 1.3) * (100vw - 320px) / (1200 - 320))
@Woorg
Woorg / scale font size
Created September 22, 2016 18:26
scale font size
font-size (16 + (24 - 16) * (100vw - 400px) / (800 - 400))
@Woorg
Woorg / download entire website wget
Last active July 17, 2023 21:39
download entire website wget
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent --span-hosts --execute robots=off --recursive --refer=https://google.com --user-agent="Safari" https://www.udemy.com/html-css-course
@Woorg
Woorg / WP Dashboard
Created August 18, 2016 00:04 — forked from andregomes/WP Dashboard
Remove Dashboard unwanted metaboxes
// Remove unwanted dashboard metaboxes
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
 
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
 
//QuickPress
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
//Wordpress Development Blog Feed
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
@Woorg
Woorg / functions.php
Created August 18, 2016 00:04 — forked from andregomes/functions.php
WordPress: Add Class to first Paragraph in WordPress the_content
<?php
/* =BEGIN: Add Class to first Paragraph in WordPress the_content();
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/
---------------------------------------------------------------------------------------------------- */
function first_paragraph($content){
// Testing to see if the content is a Page or Custom Post Type of school, if so, display the text normally (without the class = intro).
if ( is_page() || ('school' == get_post_type() ) ) {
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1);
} else {
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
@Woorg
Woorg / functions.php
Created August 18, 2016 00:04 — forked from andregomes/functions.php
Wordpress: Add SVG upload support to a theme
<?php
// add to functions.php in your WordPress theme
add_filter('upload_mimes', 'm6z_upload_mimes');
function m6z_upload_mimes($mimes = array())
{
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
?>