Skip to content

Instantly share code, notes, and snippets.

View RustBeard's full-sized avatar

Marek RustBeard

  • Poland, Gdansk
View GitHub Profile
@addyosmani
addyosmani / jQueryPluginPatterns.js
Created August 31, 2011 18:02
jQuery Plugin Patterns
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
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/
@tqc
tqc / rgbatorgb.js
Created May 1, 2012 01:39
Convert RGBA to RGB
function RGBAtoRGB(r, g, b, a, r2,g2,b2){
var r3 = Math.round(((1 - a) * r2) + (a * r))
var g3 = Math.round(((1 - a) * g2) + (a * g))
var b3 = Math.round(((1 - a) * b2) + (a * b))
return "rgb("+r3+","+g3+","+b3+")";
}
$("#result").html(RGBAtoRGB(225,110,0,0.5,255,255,255));
@MattFielding
MattFielding / style.css
Created February 11, 2013 14:14
Responsive images in Drupal. The height and width attributes need removing from the <img> elements and we need to add a little CSS to allow the images to scale correctly
img {
max-width:100%;
height:auto;
}
@ayezee33
ayezee33 / gulpfile.js
Created December 29, 2015 06:11
Foundation 6 Starter Template Gulpfile with Browsersync
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var reload = browserSync.reload;
var sassPaths = [
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src'
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");