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 / AJAX-conditional-layout.twig
Created August 17, 2015 18:01
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.
{# Extend a different layout if requested via AJAX #}
{% extends app.request.isXmlHttpRequest ? 'layout-ajax.twig' : 'layout.twig' %}
@zomars
zomars / SassMeister-input.scss
Created May 25, 2015 15:35
Generated by SassMeister.com.
// ----
// 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 / gist:6f94bcd8528ff1b82ea8
Created April 21, 2015 21:33
wordpress-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 April 8, 2015 22:47
Fix the Magic Spaces PHP Issue in some shared hosts
<?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);
?>
@zomars
zomars / bolt-install.php
Created April 8, 2015 22:32
Bolt.cm one click install
<?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 / snippet.js
Last active August 29, 2015 14:16 — forked from necolas/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 / Single-Element-Split-Button.markdown
Created January 20, 2015 18:48
Single Element Split Button

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.