Skip to content

Instantly share code, notes, and snippets.

View wazazaby's full-sized avatar
🗿

Teddy Sommavilla wazazaby

🗿
View GitHub Profile
{
"name": "reviung39",
"vendorProductId": 1196711696,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_TAB",
"KC_Q",
"KC_W",
"KC_E",
/* Copyright 2019 Naoto Takai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// From snapshot to a simple JS object
const getObjFromDocumentSnapshot = snapshot => snapshot.data();
// From an object like this -> { 'RIP Code': { en: { '8274': 'My english value' } } }
// To this -> 'My english value'
const getter = propName => either(pipe(path([propName, 'en']), values, head), always(''));
const ripCodeGetter = getter('RIP Code');
// Check if the RIP Code property of the given object matchs ripCode
const ripCodeExistsInObj = ripCode => pipe(ripCodeGetter, equals(ripCode));
@wazazaby
wazazaby / ramda-fizzbuzz.js
Created March 26, 2021 10:01
Simple FizzBuzz using the Ramda library. Let me know if anything can be implemented in a better way :)
import R from 'ramda';
const isModulo = R.curry(R.pipe(R.flip(R.modulo), R.equals(0)));
const fizzbuzz = R.pipe(
R.add(1),
R.range(1),
R.map(
R.cond([
[R.both(isModulo(3), isModulo(5)), R.always('FizzBuzz')],
@wazazaby
wazazaby / one-piece-characters.json
Created March 24, 2021 12:14
JSON file containing One Piece characters
{
"characters": [
{
"id": 1,
"image_path": "https://image.onepiecewt100.com/vote_image/0001.jpg",
"large_image_path": "https://image.onepiecewt100.com/vote_large_image/0001.jpg",
"name": {
"cn": "蒙奇·D·路飞",
"en": "MONKEY.D.LUFFY",
"ja": "モンキー・D・ルフィ",
// This script allows you to download the new albums created by the Studio Ghibli on their website
// For example, open this one: https://www.ghibli.jp/works/laputa/
// Copy-paste this function in the console
// And then, simply call it!
async function getImages() {
const images = document.querySelectorAll('a.panelarea');
// Count to know when to sleep and avoid the limit of simultaneous downloads in Chrome (10)
let count = 0;
for (let image of images) {
let newLink = document.createElement('a');
module Main exposing (..)
import Browser
import Html exposing (Html, div, button, select, option, text)
import Html.Attributes exposing (style, value)
import Html.Events exposing (onInput)
-- MAIN
main = Browser.sandbox { init = init, update = update, view = view }
const fizzbuzz = number => {
const isFizz = number => number % 5 === 0;
const isBuzz = number => number % 3 === 0;
const genIterable = number => [...Array(number).keys()].map(i => i + 1);
const verification = number => {
if (isFizz(number) && isBuzz(number)) return 'fizzbuzz';
if (isFizz(number)) return 'fizz';
if (isBuzz(number)) return 'buzz';
return number