Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
WebsKit momentum

Juan Carlos Galindo Navarro oceangravity

💭
WebsKit momentum
View GitHub Profile
View Test.vue
<template>
<div>Data: {{ data }}</div>
<button @mousedown="method"></button>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue'
const test = ref(100)
const data = computed(() => test.value + 200)
View BitmapHoles.php
<?php
/**
* Bitmap Holes
* Have the function BitmapHoles(strArr) take the array of strings stored in strArr,
* which will be a 2D matrix of 0 and 1's, and determine how many holes, or contiguous regions of 0's,
* exist in the matrix. A contiguous region is one where there is a connected group of 0's going
* in one or more of four directions: up, down, left, or right.
*
* For example: if strArr is ["10111", "10101", "11101", "11111"], then this looks like the following matrix:
*
@oceangravity
oceangravity / LongestIncreasingSequence.php
Created Dec 2, 2021
Have the function LongestIncreasingSequence(arr) take the array of positive integers stored in arr and return the length of the longest increasing subsequence (LIS). A LIS is a subset of the original list where the numbers are in sorted order, from lowest to highest, and are in increasing order. The sequence does not need to be contiguous or uni…
View LongestIncreasingSequence.php
<?php
/**
* Longest Increasing Sequence
* Have the function LongestIncreasingSequence(arr) take the array of positive integers stored in arr
* and return the length of the longest increasing subsequence (LIS). A LIS is a subset of the original list
* where the numbers are in sorted order, from lowest to highest, and are in increasing order.
* The sequence does not need to be contiguous or unique, and there can be several different subsequences.
* For example: if arr is [4, 3, 5, 1, 6] then a possible LIS is [3, 5, 6], and another is [1, 6].
* For this input, your program should return 3 because that is the length of the longest increasing subsequence.
*
View WKComponentInstance.vue
<template>
<keep-alive>
<transition-group tag="div" name="tool" appear>
<div class="wk-tool-inner" v-for="number in [active]" v-bind:key="number">
<component :is="componentInstance"/>
</div>
</transition-group>
</keep-alive>
</template>
<script>
View service-worker.js
var CACHE_VERSION = 'WebsKit-CACHE-E05'
var CACHE_FILES = [
'./'
]
self.addEventListener('install', function (event) {
event.waitUntil(
caches.open(CACHE_VERSION)
.then(function (cache) {
View HTML
<biblioteca>
<libro>
<nombre>Mastering Gradle</nombre>
<autor>Mainak Mitra</autor>
</libro>
<libro>
<nombre>Mastering GitHub</nombre>
<autor>Mainak Mitra</autor>
</libro>
<libro>
View CoinChange
class CoinChange {
constructor(changes) {
this.coins = 0;
this.changes = changes;
this.output = {};
};
getEquivalence(equivalence) {
let output = 0;
if(this.coins / equivalence > 1){
output = (this.coins - (this.coins % equivalence)) / equivalence;
View CoinChange.js
class CoinChange {
constructor(changes) {
this.coins = 0;
this.changes = changes;
this.output = {};
};
getEquivalence(equivalence) {
let output = 0;
if(this.coins / equivalence > 1){
output = (this.coins - (this.coins % equivalence)) / equivalence;
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function parse(subselector) {
View designer.html
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.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="../topeka-elements/category-icons.html">
<polymer-element name="my-element">