Skip to content

Instantly share code, notes, and snippets.

View davision's full-sized avatar
:octocat:
Vuetifying the web.

David Licen davision

:octocat:
Vuetifying the web.
View GitHub Profile
@ghalusa
ghalusa / youtube_id_regex.php
Created June 20, 2015 23:14
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@yann-yinn
yann-yinn / nuxt-js-and-gsheet-example.vue
Last active August 27, 2018 19:00
Nuxt.js vue component to display datas from a google spreadsheet (with google api V4 without oAuth )
<template>
<div id="homepage">
<h1>Les dernières Articles</h1>
<div class="article" v-for="article in articles">
<h2> {{ article.title }} </h2>
<p> {{ article.content }} </p>
</div>
</div>
</template>
@kieranmv95
kieranmv95 / _spacing-helper.scss
Last active February 6, 2019 02:10
Generates a array of spacing helper classes for margin and padding
// Customisable spacing units. these can be changed and new ones added
$spacing-units: (
1: 3px,
2: 5px,
3: 8px,
4: 13px,
5: 21px,
);
// These will not change this is just to help generate the classes with the correct naming
@davision
davision / vue2-countdown.vue
Last active May 3, 2024 13:22
Simple countdown component for VueJS 2
<template lang="html">
<div v-if="isEnded">
Ended.
</div>
<div v-else>
<div>Days: {{ days }}</div>
<div>Hours: {{ hours }}</div>
<div>Minutes: {{ minutes }}</div>
<div>Seconds: {{ seconds }}</div>
@davision
davision / theme_preprocess.php
Last active December 15, 2021 00:21
How to get URL from Media entity field inside a paragraph in Drupal 8
<?php
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Url;
use Drupal\media\Entity\Media;
use Drupal\Core\Site\Settings;
use Drupal\file\Entity\File;
/**
* Preprocess functions for background iamge in Tagline paragraph
@davision
davision / hamburger-menu.scss
Last active August 8, 2020 10:54
Simple animated mobile hamburger menu
#hamburger {
color: white;
font-size: 2rem;
width: inherit;
z-index: 501;
.line {
width: 30px;
height: 4px;
background-color: #ecf0f1;
@davision
davision / menu--main.html.twig
Last active August 8, 2020 10:50
Custom Drupal main menu which detects Log in link an adds class to it
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes.addClass('menu') }}>
{% else %}
<ul class="menu">
{% endif %}
{% for item in items %}
{%
@otobrglez
otobrglez / data.yml
Created March 21, 2018 16:37
Transforming yaml to another yaml.
header:
label: 'Header'
breakpoint:
fallback:
name: header_fallback
label: 'Header @ fallback (306 x 172)'
width: 306
height: 172
small:
name: header_small
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@xpepermint
xpepermint / facts.md
Last active April 3, 2018 07:45
0xcert protocol specification

Whitepaper: https://0xcert.org/whitepaper.pdf

Non-fungible Token

  • A unique, one-of-a-kind asset.
  • A digital asset like a collectible, a document or a thing.
  • Follows ERC721 specification.

Xcert