Skip to content

Instantly share code, notes, and snippets.

View jvmonjo's full-sized avatar
👨‍💻
Trying not to work too much

Josep jvmonjo

👨‍💻
Trying not to work too much
View GitHub Profile
@jvmonjo
jvmonjo / designer.html
Last active August 29, 2015 14:09
designer
<link href="../core-drawer-panel/core-drawer-panel.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../topeka-elements/avatars.html" rel="import">
<link href="../core-icon/core-icon.html" rel="import">
<polymer-element name="my-element">
<template>
<style>
@jvmonjo
jvmonjo / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
Public Function Validar_NIF(ByVal nif As String) As Boolean
Dim aux As String
nif = UCase(nif) 'ponemos la letra en mayuscula
aux = Mid(nif, 1, Len(nif) - 1) 'quitamos la letra del nif
If Len(aux) >= 7 And IsNumeric(aux) Then
aux = Calcular_NIF(aux, False) 'calculamos la letra del NIF para comparar con la que tenemos
Else
MsgBox ("El dato introducido no corresponde a un NIF")
Validar_NIF = False
Public Function calculaAnys(dataOrigen As Date) As Integer
calculaAnys = Int((Date - dataOrigen) / 365.25)
End Function
Public Function calculaTrienis(ingres As Date) As Integer
Dim anys As Integer
anys = Int((Date - ingres) / 365.25)
calculaTrienis = Fix(anys / 3)
End Function
/* Add blur_module to Text Module Settings > Custom CSS > CSS Class,
or blur_background_module to Section Module Settings > Custom CSS > CSS Class */
.blur_module,
.blur_background_module {
background-position: top center;
background-repeat: repeat;
display: block;
overflow: hidden;
position: relative;
}
if(typeof arrayName[index] === 'undefined') {
// does not exist
}
else {
// does exist
}
@jvmonjo
jvmonjo / repeat-collapse-snippet.html
Created March 10, 2017 14:19 — forked from vtellier/repeat-collapse-snippet.html
Polymer iron-collapse with dom-repeat snippet
<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../../bower_components/iron-collapse/iron-collapse.html">
<dom-module id="your-element">
<template>
<style>
.heading {
padding: 10px 15px;

##Readme

Add yourself to the www-data group and set the setgid bit on the /var/www directory such that all newly created files inherit this group as well.

sudo gpasswd -a "$USER" www-data Correct previously created files (assuming you to be the only user of /var/www):

sudo chown -R "$USER":www-data /var/www find /var/www -type f -exec chmod 0660 {} ; sudo find /var/www -type d -exec chmod 2770 {} ;

@jvmonjo
jvmonjo / countries.json
Created October 15, 2017 16:07 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},