Skip to content

Instantly share code, notes, and snippets.

View peksi's full-sized avatar

Pekka Lammi peksi

View GitHub Profile
@peksi
peksi / App.js
Created January 28, 2021 07:39
how to include p5js into react
import "./App.css";
import p5 from "p5";
import { useEffect } from "react";
const myOwnSketch = (sketch) => {
// the function s can be outside a react function since it's not actually react
let x = 100;
let y = 100;
sketch.setup = () => {
@peksi
peksi / index.html
Created January 15, 2019 08:17
vare svg map
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Väre map</title>
<style type="text/css">
body {
@peksi
peksi / menu.twig
Last active February 8, 2021 10:51
Bootstrap dropdown navbar implementation for Wordpress Timber plugin.
{# Bootstrap dropdown navbar for Wordpress #}
<ul class="nav navbar-nav">
{% for item in menu %}
{% if (item.get_children) %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{item.title}} <span class="caret"></span></a>
<ul class="dropdown-menu">
{% for subitem in item.get_children %}