Skip to content

Instantly share code, notes, and snippets.

View 7studio's full-sized avatar

Xavier Zalawa 7studio

View GitHub Profile
@eQRoeil
eQRoeil / scrollin-up.js
Last active December 29, 2015 01:19
scrollin-up.js adds .su--scrollinUp to body when (and only) scrolling up http://soqr.fr/scrollin-up Pascal Cauhépé @eQRoeil
/*! scrollin-up.js
* adds .su--scrollinUp to body
* when (and only) scrolling up
* http://soqr.fr/scrollin-up
* @author Pascal Cauhépé @eQRoeil
*/
//do not execute if addEventListener is not supported
if (window.addEventListener) {
//from underscore.js
@Integralist
Integralist / arguments vs parameters.js
Last active November 27, 2023 10:03
[The distinction between "arguments" and "parameters"] #args #params #vs
/*
Arguments are used when a function is being called.
We pass arguments to functions.
Parameters are set up when the function is defined.
So it is said that parameters are used to define a function and arguments are used to invoke a function.
These words are typically interchangeable but knowing the distinction can be handy.
*/
var myFunction = function(x,y,z){ // x,y,z are parameters
return x+y+z
@kaelig
kaelig / SassMeister-input-HTML.html
Created December 16, 2013 12:14
Generated by SassMeister.com.
<h1>Row test</h1>
<!--[if (lte IE 9) & (!IEMobile)]>
<div class="old-ie">
<![endif]-->
<!-- items: 2 -->
<div class="l-row l-row--items-2">
<div class="l-row__item l-row__item--boost-1">1+</div>
<div class="l-row__item">2</div>
</div>
@sindresorhus
sindresorhus / post-merge
Last active April 24, 2026 10:29
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@sturobson
sturobson / gulpfile.js
Last active October 9, 2020 13:01
My gulpfile.js (so far, so simple). Compiles Sass (removes erroneous _partial compilation), autoprefixes the CSS then minifies the CSS into the folder 'dist/CSS'. Uglifys JS into the foloder 'dist/JS'. Minifys SVGs using SVGO, Minifys images with imagemin. Adds gulp-size to calculate project size. Runs development and production tasks
// Deep Breaths //
//////////////////
// Gulp
var gulp = require('gulp');
// Sass/CSS stuff
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
@bpierre
bpierre / hash.js
Created February 23, 2014 17:56
Mini location.hash system + mini routing system (useful with PhoneGap)
/*
* Mini location.hash update system
*
* Usage:
*
* var createHash = require('./hash');
* var hash = createHash('!/', function(value) {
* // Value updated
* });
*
var isArray = function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};

Devices

iPhone
GT-I9300
SAMSUNG GT-I9505
HTC One
Lumia 520
iPad
GT-I9100
GT-I9505
Lumia 920

.initial
.top-banner-ad-container
.top-banner-ad-container--desktop
.top-banner-ad-container--facia-layout
.ad-slot
module Sass::Script::Functions
def file_exists(path)
return bool(false) unless options[:filename] # not all sass has a file name (e.g. std input)
current_directory = File.dirname(options[:filename]) rescue nil # a sass filename from an importer may not be processable by File.dirname
return bool(false) unless current_directory && File.exist?(current_directory) # not all sass files are served from the filesystem
full_path = File.expand_path(path.value, current_directory) # a relative path will be expanded against the current_directory of the sass file, symlinks will be followed, absolute paths will be left alone.
return bool(File.exist?(full_path))
end
end