Skip to content

Instantly share code, notes, and snippets.

View miryamfv's full-sized avatar

Miryam miryamfv

View GitHub Profile
@sryabov
sryabov / autocomplete.vue
Created June 20, 2018 20:07
vuetify autocomplete component example
<template>
<v-autocomplete
v-model="select"
:loading="loading"
:items="items"
:search-input.sync="search"
no-filter
hide-selected
clearable
return-object
@Tom-Millard
Tom-Millard / lazy-fonts.js
Created February 1, 2018 17:47
Lazy load google fonts
(function(d){
var x = d.createElement("link");
var y = d.getElementsByTagName("script")[0];
x.rel = "stylesheet";
x.href = "https://fonts.googleapis.com/css?family=Raleway:400,900";
y.parentNode.insertBefore(x, y);
})(document);
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@ZeroDragon
ZeroDragon / README.md
Last active November 11, 2023 18:39
Este es un grid system para CSS

Stylus Minimal Grid System

Un sistema de columnas para CSS, basado en 12 columnas, líquido, MVP.
Puede ser usado como semilla para extenderlo a diferentes resoluciones o páginas responsivas.

Por default el gap entre columnas es de 10px, pero se puede cambiar con la variable gap en la línea 2

## Update 2016-09-30 Agrego una versión modificada responsiva. Incluye la misma base a 12 columnas, reduje el gap a 8px Hice el grid a 5 saltos responsivos:

@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
@AllThingsSmitty
AllThingsSmitty / flexslider.htm
Created February 1, 2015 03:45
Lazy loading images for FlexSlider
<section class="slider">
<div class="flexslider">
<ul class="slides">
<li><img src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
</ul>
</div>
@BronsonQuick
BronsonQuick / loop_through_post_attachments.php
Created March 4, 2012 06:56
A WordPress loop to display post/page attachments
<?php /*
* This is just a simple loop to display 7 attachments attached to a post or page in WordPress
* You can change 'medium' and 'thumbnail' to add sizes you have definied in your theme by the add_image_size function
* in WordPress
*/
?>
<div id="thumbs" class="pic_list">
<ul class="thumbs">
<?php /* Time to create a new loop that pulls out the first 7 image attachments for this post */
$args = array( 'post_type' => 'attachment', 'numberposts' => 7, 'post_status' => null, 'post_parent' => $post->ID );
@markupboy
markupboy / html5video.sh
Created February 8, 2011 15:43
automated conversion of a file to all three html5 compatible video formats - h.264, ogg, and webm
#!/bin/sh
####################################
# Output file for HTML5 video #
# Requirements: #
# - handbrakecli #
# - ffmpeg #
# - ffmpeg2theora #
# #
# usage: #
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array