Skip to content

Instantly share code, notes, and snippets.

View pketh's full-sized avatar
🐢
https://kinopio.club

Pirijan pketh

🐢
https://kinopio.club
View GitHub Profile
moveZeros([1, 2, 0, 1, 0, 0, 3, 6])
const moveZeroes = (numbers) => {
let zeroes = []
numbers = numbers.filter(number => {
if (number === 0) {
zeroes.push(number)
} else {
return true
}
꒰◍ᐡᐤᐡ◍꒱ ␈␈␈␈␈␈␈␈
@pketh
pketh / cache.js
Created March 26, 2020 03:03
kinopio ls cache system
// local storage cache interface for currentUser and spaces
import utils from '@/utils.js'
export default {
storeLocal (key, value) {
try {
window.localStorage[key] = JSON.stringify(value)
} catch (error) {
console.warn('storeLocal Could not save to localStorage')
@pketh
pketh / hi.md
Created December 17, 2019 19:42
Kinopio Reliability Fixes dec 17 2019

Reliability Fixes

I just released some client/server patches that should address issues reported, (be sure to refresh next time you use kinopio). here's the list of what's fixed:

🐛Reported Issue:

  • when you clicked the space selection button and were seeing extra spaces that would flash and then go away.

🏥Resolution:

@pketh
pketh / ManyToManyRelationships.md
Created September 20, 2019 17:21 — forked from elliette/ManyToManyRelationships.md
Describing `belongsToMany` and `hasMany` methods in Sequelize

Defining Many-to-Many Associations in Sequelize

Reference: Sequelize docs on association

Let’s say we have two models: Films and Festivals

We know that a film can be shown at many film festivals and that, conversely, a festival can show many films. This is what is known as a many-to-many relationship.

Knowing this, we can set up our associations:

@pketh
pketh / easing.js
Created June 21, 2019 14:21
easings js
easing (percentComplete, elaspedTime) {
const duration = lockingDuration
const startValue = 0
const endValue = 1
// https://stackoverflow.com/questions/8316882/what-is-an-easing-function
// x percentComplete,
// t elaspedTime,
// b startValue,
// c endValue,
// d duration
@pketh
pketh / random splatter.coffee
Created February 7, 2019 22:05
random splatters
# addRandomSplatter = ->
# maxX = window.innerWidth
# maxY = window.innerHeight
# x = _.random 0, maxX
# y = _.random 0, maxY
# if consecutiveRandomSplatters < MAX_CONSECUTIVE_SPLATTERS
# consecutiveRandomSplatters += 1
# addSplatter x, y
#
# autoSplatter = ->
@pketh
pketh / static.coffee
Created February 7, 2019 22:03
dynamic static
# viewportWidth = window.innerWidth
# viewportHeight = window.innerHeight
# totalPixels = viewportWidth * viewportHeight
# staticPixels = Math.round(totalPixels * 0.05) # 5 percent static
# staticCanvas = undefined
# staticContext = undefined
# staticCanvasImage = undefined
# frames = Array.from(Array(24)) # 24 variations
window.onload = ->
@pketh
pketh / confetti.js
Created December 12, 2018 17:23
confetti pours on you after you buy something in glitch/hyperweb
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
"use strict";
/* istanbul ignore next */
module.exports = function(canvas) {
(*・_・)ノ⌒*
(*・_・)⊃══✫⌒*・゚✲