Skip to content

Instantly share code, notes, and snippets.

@xar
xar / gist:1115e98f7691c05547ca
Last active August 29, 2015 14:15
Ultimatny sass mixin
@mixin bp($point, $high:'', $low:'') {
/* XS */
$mobile-max: 767;
@if $point == xs {
@if $high != '' {
$mobile-max: $high;
}
}
@xar
xar / gulfile
Created February 13, 2015 08:50
gulpfile
var gulp = require('gulp');
var browserSync = require('browser-sync');
var plumber = require('gulp-plumber');
var reload = browserSync.reload;
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var rename = require('gulp-rename');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
@mixin bp($point, $high:'', $low:'') {
/* XS */
$mobile-max: 767;
$mobile-min: 1;
@if $point == xs {
@if $high != '' {
$mobile-max: $high;
}
@if $low != '' {
height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
cheight = $('.main-content').innerHeight();
if (height < cheight) {
height = cheight;
}
setHeight = function(height) {
$('.menu-block').css({
"min-height": height
});
@xar
xar / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xar
xar / gist:8a3b0f67d17424f05ecc
Created April 3, 2015 22:42
less responsive mixin
/* Responsive hack - Bootstrap */
@screen-xs: 300px;
@screen-xs-min: @screen-xs;
@screen-phone: @screen-xs-min;
// Small screen / tablet
// Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1
@screen-sm: 620px;
@screen-sm-min: @screen-sm;
@screen-tablet: @screen-sm-min;
@xar
xar / timezone_dst.json
Created July 29, 2016 14:09
Timezones with DST offset
[
{
"id":"1",
"time_offset":"+00:00",
"name":"Africa\/Abidjan",
"time_offset_dst":"+00:00"
},
{
"id":"2",
"time_offset":"+00:00",
*/30 * * * * say -v whisper "I am watching you"
@xar
xar / Sentry remove auth
Created August 28, 2016 10:21
Remove register option from sentry in docker.
docker exec -it sentry_container_id bash
echo "SENTRY_FEATURES['auth:register'] = False" >> /etc/sentry/sentry.conf.py
restart container
@xar
xar / coverage.js
Created February 26, 2018 21:53 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*
* Shows how to use Puppeeteer's code coverage API to measure CSS/JS coverage across
* different points of time during loading. Great for determining if a lazy loading strategy
* is paying off or working correctly.
*
* Install:
* npm i puppeteer chalk cli-table