Skip to content

Instantly share code, notes, and snippets.

@noxify
noxify / helpers_parquet.ts
Last active May 9, 2023 14:42
Parquet generation via JSON-Schema
// file: helpers/parquet.ts
import {
FieldDefinition,
ParquetType,
SchemaDefinition,
} from '@dsnp/parquetjs/dist/lib/declare'
import { JSONSchema4 } from 'json-schema'
export function createStringField({
optional = true,
@noxify
noxify / CustomImage.tsx
Created September 19, 2022 08:39
custom image for tailwind ui syntax template
// src/components/CustomImage.tsx
import Image from 'next/image'
import 'yet-another-react-lightbox/styles.css'
import Lightbox from 'yet-another-react-lightbox'
import { useState } from 'react'
/**
* Generates the correct asset and base path
* for the gitlab pages
@noxify
noxify / Calendar.vue
Created December 24, 2020 12:07
Reactive Calendar filter
// /src/pages/Calendar.vue
// --> http://localhost:8080/calendar
<template>
<div>
<datetime v-model="date"></datetime>
<ul>
<li v-for="event in filteredList" :key="event.id">
{{ event.node.summary }}
.
|-src
| |-components
| |-layouts
| |-templates
| |-assets
| | |-remoteImages
| | | |- image.png ( <-- my example image which is used in the code below )
| |-pages
|-packages
<?php
function loadCss() {
wp_enqueue_style('bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css');
}
function loadJavascript() {
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.5.1.slim.min.js', array(), null, true);
wp_enqueue_script('popperjs', 'https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js', array('jquery'), false, true);
@noxify
noxify / content-example.js
Created February 9, 2020 13:09
gridsome - download remote files
// /content/entries/entry1.md
---
title: First Post
excerpt: First Post
date: 2020-01-14T21:53:14.578Z
localImage: ./sumit-saharkar-d3_ssraccV8-unsplash.jpg
remoteImage: https://images.unsplash.com/photo-1580451998921-c1e6e1ababe0?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2850&q=80
---
@noxify
noxify / Testing.vue
Last active December 10, 2019 21:39
/*
/src/pages/Testing.vue
*/
<template>
<DefaultLayout>
<ul>
<li
v-for="edge in $page.records.edges"
:key="edge.node.id"
>
//hugo
@noxify
noxify / file1.js
Last active September 7, 2019 14:05
test gist
//source https://gridsome.org/docs/taxonomies
api.loadSource(store => {
const posts = store.addContentType('Post')
const tags = store.addContentType('Tag')
// makes all ids in the `tags` field reference a `Tag`
posts.addReference('tags', 'Tag')
tags.addNode({
id: '1',
@noxify
noxify / Page.php
Created December 18, 2018 12:14
Twill pages - custom edit template
//app/Models/Page.php
<?php
namespace App\Models;
use A17\Twill\Models\Behaviors\HasBlocks;
use A17\Twill\Models\Behaviors\HasSlug;
use A17\Twill\Models\Behaviors\HasMedias;
use A17\Twill\Models\Behaviors\HasRevisions;