This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { fade, fly } from 'svelte/transition'; | |
let uid = 1; | |
let newTodo = ""; | |
let todos = [ | |
{ id: uid++, done: true, task: 'Test Svelte' }, | |
{ id: uid++, done: true, task: 'Uset NES.css' }, | |
{ id: uid++, done: true, task: 'Implement TODO list layout' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$: rates = []; | |
async function fetchData() { | |
const res = await fetch("https://api.exchangeratesapi.io/latest"); | |
const data = await res.json(); | |
if (res.ok) { | |
for (const [key, value] of Object.entries(data.rates)) { | |
rates.push({currency: key, value: value}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
var lock = LockService.getPublicLock(); | |
lock.waitLock(30000); | |
var file = SpreadsheetApp.openByUrl(e.parameter.sheetUrl); | |
//Select the first page in the Sheet document | |
var sheet = file.getSheets()[0]; | |
// if(e.parameter.sheetName) { | |
// sheet = file.getSheetByName(unescape(e.parameter.sheetName)); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="wrapper"> | |
<canvas id="canvas" width="450" height="450"></canvas> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class TextLink { | |
public static void makeLink(TextView textView, String link, ClickableSpan clickableSpan) { | |
SpannableString spannableString = new SpannableString(textView.getText()); | |
int startIndexOfLink = textView.getText().toString().indexOf(link); | |
spannableString.setSpan(clickableSpan, startIndexOfLink, startIndexOfLink + link.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{defer, dispatch} = Turbolinks | |
handleEvent = (eventName, handler) -> | |
document.addEventListener(eventName, handler, false) | |
translateEvent = ({from, to}) -> | |
handler = (event) -> | |
event = dispatch(to, target: event.target, cancelable: event.cancelable, data: event.data) | |
event.preventDefault() if event.defaultPrevented | |
handleEvent(from, handler) |