Skip to content

Instantly share code, notes, and snippets.

Avatar
🙏
Never stop learning

Omar López zomars

🙏
Never stop learning
View GitHub Profile
View Single-Element-Split-Button.markdown

Single Element Split Button

This creates a split button using a single element, it uses pseudo elements and data attributes.

A Pen by zomars on CodePen.

License.

View snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@zomars
zomars / bolt-install.php
Created Apr 8, 2015
Bolt.cm one click install
View bolt-install.php
<?php
// Script to install the latest version of Bolt.cm CMS
// Define function to test if curl is installed on the server
function _is_curl_installed() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
} else {
return false;
}
@zomars
zomars / fixyourdamn.php
Created Apr 8, 2015
Fix the Magic Spaces PHP Issue in some shared hosts
View fixyourdamn.php
<?php
exec("cp " . php_ini_loaded_file() . " " . $_SERVER['DOCUMENT_ROOT'] . "/php.ini");
fwrite(fopen("{$_SERVER['DOCUMENT_ROOT']}/php.ini", 'a'), PHP_EOL . '[PHP]' . PHP_EOL . "magic_quotes_gpc = Off" . PHP_EOL);
fwrite(fopen("{$_SERVER['DOCUMENT_ROOT']}/.htaccess", 'a'), PHP_EOL . "SetEnv PHPRC {$_SERVER['DOCUMENT_ROOT']}/php.ini" . PHP_EOL);
?>
View gist:6f94bcd8528ff1b82ea8
<?php
// Script to install the latest version of Bolt.cm CMS
// Define function to test if curl is installed on the server
function _is_curl_installed() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
} else {
return false;
}
@zomars
zomars / SassMeister-input.scss
Created May 25, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$spacing-unit: 24px;
$spacing-unit-tiny: round(0.25 * $spacing-unit);
$spacing-unit-small: round(0.5 * $spacing-unit);
$spacing-unit-large: round(2 * $spacing-unit);
@zomars
zomars / AJAX-conditional-layout.twig
Created Aug 17, 2015
AJAX conditional layout, This is useful if you planing to get only the content of a page or content type via AJAX, by calling a bare bones layout.
View AJAX-conditional-layout.twig
{# Extend a different layout if requested via AJAX #}
{% extends app.request.isXmlHttpRequest ? 'layout-ajax.twig' : 'layout.twig' %}
@zomars
zomars / encounterGradient.css
Last active Feb 18, 2016 — forked from anonymous/my.css
CSS Gradient Animation
View encounterGradient.css
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%}
@zomars
zomars / generate-vertical-sprite-from-video.sh
Last active Jan 15, 2018 — forked from vvo/video-snapshots-sprites.sh
generate a vertical sprite sheet from video file
View generate-vertical-sprite-from-video.sh
# 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 / Export Layers To Files (Clean).jsx
Created Dec 13, 2016
Export Photoshop layers to files without numeric sequence nor underscores
View Export Layers To Files (Clean).jsx
// 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
/*