Skip to content

Instantly share code, notes, and snippets.

@xar
xar / storage.rules
Created November 7, 2022 15:23
Storage rules exception
// https://firebase.google.com/docs/reference/security/storage
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
function checkFileSize() {
return true;
// return request.resource.size < 10 * 1024 * 1024; // 10MB file size limit
}
function hasPermissionToReadResource(resourceType, resourceId) {
@xar
xar / Dockerfile
Created March 8, 2022 22:16
Cypress & Node
# update the base packages and add a non-sudo user
RUN apt-get update -y && apt-get upgrade -y && adduser --ingroup docker docker
# install python and the packages the your code depends on along with jq so we can parse JSON
# add additional packages as necessary
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant xvfb libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth && \
@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
@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
*/30 * * * * say -v whisper "I am watching you"
@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",
@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 / 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
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
});
@mixin bp($point, $high:'', $low:'') {
/* XS */
$mobile-max: 767;
$mobile-min: 1;
@if $point == xs {
@if $high != '' {
$mobile-max: $high;
}
@if $low != '' {