Skip to content

Instantly share code, notes, and snippets.

View dahngeek's full-sized avatar
🖥️
Working on PWAs

Daniel Xutuc dahngeek

🖥️
Working on PWAs
View GitHub Profile
@dahngeek
dahngeek / gist:7667666
Created November 26, 2013 22:44
REvisar si un elemento existe sino... hacer algo
if ($('#some_element').length == 0) {
//Add it to the dom
}
@dahngeek
dahngeek / sacainfocadaarray.php
Last active December 29, 2015 11:59
Para wordpress: inserta un meta (primera parte), y la segunda crea un meta con un array para luego solo sacar los datos como array. el segundo archivo es el mismo que el primero pero en otra parte.. lo que hace es sacar un array con todos los metas no unicos.. y de alli sacar uno para eliminarlo...
$pizzas_hot_ready = get_post_meta($menu_adminId, 'pizzas_hot_ready', false);
foreach ($pizzas_hot_ready as $key => $value) {
echo '<span class="titulo '.$value['key'].'">'.$value['nombre'].'</span>';
echo '<span class="descripcion '.$value['key'].'">'.$value['descripcion'].'</span>';
echo '<span class="imagen '.$value['key'].'">'.$mediapath.$value['imagen'].'</span>';
echo '<span class="identificador '.$value['key'].'">'.$key.'</span>';
echo '<span class="from '.$value['key'].'">pizzas_hot_ready</span>'; //Cuidado!!! esto se cambia para cada digamos aqui es para las hot_ready
}
@dahngeek
dahngeek / detectarCambio.js
Created November 28, 2013 14:34
========== JAVASCRIPT MEDIA QUERYS ============== 1 Archivo = Detectar cambio de tamanio, media query javascript: 2 Archivo = detecgar el tamano al inicio (Media Query solo al inicio)
// media query event handler
if (matchMedia) {
var mq = window.matchMedia("(min-width: 500px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
// media query change
function WidthChange(mq) {
@dahngeek
dahngeek / estilo.css
Created November 29, 2013 19:01
genera un fondo personalizado al select asi es personalizado.. y en la parte de colors.. genera colores al azar a partir de un array.
.select {
position: absolute;
width: 300px; /* With the padding included, the width is 190 pixels: the actual width of the image. */
height: 50px;
padding: 15px 50px 0px 20px;
color: #aaa;
font-family: 'avenir_lt_35_lightregular';
font-size: 22px;
background: url(../media/imagenes/seguros-autos/selectbox.png) no-repeat #fff right center;
overflow: hidden;
@dahngeek
dahngeek / ActualizaHoraServer.js
Last active December 30, 2015 09:39
PHP script que genera la Fecha yla Hora del Server
jQuery(document).ready(function($){
var localTime = +Date.now();
var timeDiff = serverTime - localTime;
setInterval(function () {
var realtime = +Date.now() + timeDiff;
var date = new Date(realtime);
// hours part from the timestamp
var hours = date.getHours();
// minutes part from the timestamp
@dahngeek
dahngeek / modifythisinyourslider.js
Created December 6, 2013 00:59
Responsive jQuery Cycle slider
var activeSlide;
$(document).ready(function() {
$('.cycle').cycle({
containerResize: 1,
width: 'fit',
after: function(curr, next, obj) {
activeSlide = obj.currSlide;
}
@dahngeek
dahngeek / responsiveCycle.js
Created December 11, 2013 14:17
jquery cycle responsive
var activeSlide;
$(document).ready(function() {
$('.cycle').cycle({
containerResize: 1,
width: 'fit',
after: function(curr, next, obj) {
activeSlide = obj.currSlide;
}
if (!strchr($_POST['email'],"@") || !strchr($_POST['email'],".")) { echo "No es un correo valido";}
@dahngeek
dahngeek / funcion
Created February 27, 2014 20:48
Abrir una pagina en la misma dirrecion del directorio
Public Sub Asdf()
MsgBox ActiveDocument.Path
ThisDocument.WebBrowser1.Navigate (ActiveDocument.Path & "\semicircunferencias.html")
End Sub
@dahngeek
dahngeek / TextoFondo
Created May 22, 2014 23:34
Texto con fondo degradado, (background attachment) solo para chrome
<q class="right">"It's not just selling a cat in a bag"</q>