Skip to content

Instantly share code, notes, and snippets.

@tx2z
tx2z / install-docker-compose.sh
Created January 12, 2019 23:40
install docker-compose in coreos
#!/bin/bash
VERSION="1.23.2"
echo "Choose docker-compose version"
echo "Check https://github.com/docker/compose/releases"
read -p "Version ($VERSION): "
if ! [ -z $REPLY ]
then
VERSION=$REPLY
fi
sudo su <<EOF
@tx2z
tx2z / cdn.conf
Last active March 29, 2021 20:47
Configure subdomain as "CDN" in NGINX (+ Wordpress & W3 Total Cache configuration) - http://jesus.perezpaz.es/2014/02/configure-subdomain-as-cdn-in-nginx-wordpress-w3-total-cache-configurations
# -------------------------------------------------
# CDN CONFIGURATION
# -------------------------------------------------
# Show "Not Found" 404 errors in place of other NGINX errors
error_page 403 /404;
error_page 404 /404;
error_page 405 /404;
error_page 500 501 502 503 504 /404;
location /404 {
server {
listen 80; ## listen for ipv4
listen [::]:80; ## listen for ipv6
server_name domain.com;
access_log /var/log/nginx/domain.com.access.log;
error_log /var/log/nginx/domain.com.error.log;
root /folder/with/wordpress/installation/;
# Include wordpress config file
<div class="flag flag-fr"></div>
<?php
// Add the correct Content-Type for the cache manifest
header('Content-Type: text/cache-manifest');
// Write the first line
echo "CACHE MANIFEST\n";
// Initialize the $hashes string
$hashes = "";
$responsive_resize: 0.6;
$px:1px;
@mixin res($rpx) {
$px: $rpx;
@content;
@media screen and (max-width: 320px) {
$px: $rpx*$responsive_resize;
@content;
}
function $$(selector, context){
return jQuery(selector.replace(/(\[|\])/g, '\\$1'),
context)
}
#imagen {
background: url(ruta a la imagen/imagen1.jpg) no-repeat;
height: (alto)px;
width: (ancho)px;
}
@tx2z
tx2z / gist:5168797
Last active December 14, 2015 23:49
Capture simple, double, triple, long and right clicks in the same element with jQuery - http://jesus.perezpaz.es/2013/01/capture-simple-double-triple-long-and-right-clicks-in-the-same-element-with-jquery/
(function($) {
// Usefull variables
var clicks = 0;
var longclick = false;
// Change the long click duration (in ms):
//jQuery.longclick.duration = 500;
$(document).ready(function() {