Skip to content

Instantly share code, notes, and snippets.

View zomars's full-sized avatar
🙏
Never stop learning

Omar López zomars

🙏
Never stop learning
View GitHub Profile
@zomars
zomars / sort-by.liquid
Last active May 15, 2018 21:18
Sort products in Shopify via dropdown in vanilla JavaScript
{%- comment -%}
Put it in your snippets folder and include it in your templates:
{% include 'sort-by' %}
{%- endcomment -%}
<div id="sort-by-container"></div>
<script>
// Get the URL search parameters
const params = new URLSearchParams(location.search);
const currentParams = params.get('sort_by');
# This is the DEVELOPMENT version of config_local.yml
# Database credentials.
database:
driver: mysql
databasename: bolt
username: database_user
password: 'hunter42'
# Use unoptimized theme in development
@zomars
zomars / _table_set.twig
Created July 26, 2017 21:53
Print a table from Advanced Custom Fields: Table Field using Timber in Twig
{% if table %}
<table>
{% if table.header %}
<thead>
<tr>
{% for th in table.header %}
<th>{{ th.c }}</th>
{% endfor %}
</tr>
</thead>
@zomars
zomars / inuitcss.css
Created May 12, 2017 21:10
Compiled InuitCSS for testing purposes
@charset "UTF-8";
/* ==========================================================================
INUITCSS
========================================================================== */
/**
* inuitcss, by @csswizardry
*
* github.com/inuitcss | inuitcss.com
*/
/**
@zomars
zomars / inuitcss.css
Created May 12, 2017 21:10
Compiled InuitCSS for testing purposes
@charset "UTF-8";
/* ==========================================================================
INUITCSS
========================================================================== */
/**
* inuitcss, by @csswizardry
*
* github.com/inuitcss | inuitcss.com
*/
/**
@zomars
zomars / boltflow-bitbucket-deploy.php
Last active April 7, 2017 16:53
Script to deploy from bitbucket via webhook and bobdenotter's Boltflow script (https://github.com/bobdenotter/boltflow)
<?php
$repo_dir = '/home/username';
$branch_to_deploy = 'master';
$update = false;
// Parse data from Bitbucket hook payload
$payload = json_decode($_POST['payload']);
if (empty($payload->commits)) {
<?php
###############################################################
# cPanel Subdomains Creator 1.1
###############################################################
# Visit http://www.zubrag.com/scripts/ for updates
###############################################################
#
# Can be used in 3 ways:
# 1. just open script in browser and fill the form
@zomars
zomars / Export Layers To Files (Clean).jsx
Created December 13, 2016 18:04
Export Photoshop layers to files without numeric sequence nor underscores
// Export Layers To Files (Clean)
// Copyright 2007. Adobe Systems, Incorporated. All rights reserved.
// This script will export each layer in the document to a separate file.
// Written by Naoki Hada
// ZStrings and auto layout by Tom Ruark
// Bug fixes by Eric Ching
// Modded for cleaner output by Zomars
/*
@zomars
zomars / generate-vertical-sprite-from-video.sh
Last active March 3, 2023 18:24 — forked from vvo/video-snapshots-sprites.sh
generate a vertical sprite sheet from video file
# fps=10
ffmpeg -i video.mp4 -f image2 -vf fps=fps=10 img%03d.jpg
# vertical sprite
files=$(ls img*.jpg | sort -t '-' -n -k 2 | tr '\n' ' ')
convert $files -append output.jpg
# references:
# http://www.imagemagick.org/script/command-line-options.php#append
# http://www.imagemagick.org/script/command-line-options.php#resize
@zomars
zomars / encounterGradient.css
Last active February 18, 2016 00:53 — forked from anonymous/my.css
CSS Gradient Animation
background: linear-gradient(1deg, #a24bcf, #cf4b4b, #c0cf4b, #52cf4b, #52cf4b, #4bc5cf, #4b79cf);
background-size: 1400% 1400%;
-webkit-animation: encounterGradient 30s ease infinite;
-moz-animation: encounterGradient 30s ease infinite;
-o-animation: encounterGradient 30s ease infinite;
animation: encounterGradient 30s ease infinite;
@-webkit-keyframes encounterGradient {
    0%{background-position:50% 0%}
    50%{background-position:51% 100%}
    100%{background-position:50% 0%}