Skip to content

Instantly share code, notes, and snippets.

View paulocoghi's full-sized avatar
🎯
Focusing

Paulo Coghi paulocoghi

🎯
Focusing
View GitHub Profile
@paulocoghi
paulocoghi / HAR.js
Created February 4, 2020 14:40
cdnjs.com's HAR with HTTP/3 enabled
This file has been truncated, but you can view the full file.
{
"log": {
"version": "1.2",
"creator": {
"name": "Firefox",
"version": "72.0.1"
},
"browser": {
"name": "Firefox",
"version": "72.0.1"
@paulocoghi
paulocoghi / App.html
Last active March 28, 2018 15:33
Multiple components and store variables ($)
<InputAdd></InputAdd>
<List></List>
<script>
import InputAdd from './InputAdd.html'
import List from './List.html'
import { Store } from 'svelte/store.js';
@paulocoghi
paulocoghi / App.html
Created March 22, 2018 19:17
Using #each blocks with store ($) variables defined in runtime
<input bind:value='newTodo' placeholder='buy milk'>
<button on:click='push("$todos", newTodo)'>add todo</button>
<ul>
{{#each $todos as todo, i}}
<li>
<button on:click='splice("$todos", i, 1)'>x</button>
{{todo}}
</li>
{{/each}}
@paulocoghi
paulocoghi / App.html
Created March 22, 2018 19:09
Using #each blocks with early defined variables (in data)
<input bind:value='newTodo' placeholder='buy milk'>
<button on:click='push("todos", newTodo)'>add todo</button>
<ul>
{{#each todos as todo, i}}
<li>
<button on:click='splice("todos", i, 1)'>x</button>
{{todo}}
</li>
{{/each}}
@paulocoghi
paulocoghi / App.html
Last active March 22, 2018 19:08
Using #each blocks with variables defined in runtime
<input bind:value='newTodo' placeholder='buy milk'>
<button on:click='push("todos", newTodo)'>add todo</button>
<ul>
{{#each todos as todo, i}}
<li>
<button on:click='splice("todos", i, 1)'>x</button>
{{todo}}
</li>
{{/each}}
@paulocoghi
paulocoghi / App.html
Last active March 28, 2018 14:24
Without multiple sub-components and store variables, everything works
<input bind:value='newTodo' placeholder='buy milk'>
<button on:click='push("$todos", newTodo)'>add todo</button>
<ul>
{{#each ( $todos || [] ) as todo, i}}
<li>
<button on:click='splice("$todos", i, 1)'>x</button>
{{todo}}
</li>
{{/each}}
/*
ractive-decorators-bootstrap-select
=============================================
Integrate Ractive with Bootstrap Select
==========================
Usage: Include this file on your page below Ractive, e.g: