Skip to content

Instantly share code, notes, and snippets.

View JulienHe's full-sized avatar
🍑
is feeling peachy

Julien Henrotte JulienHe

🍑
is feeling peachy
View GitHub Profile
@JulienHe
JulienHe / getArticle.graphql.tsx
Created September 5, 2022 03:35
Get Article Graphql
import { gql } from "@apollo/client";
const GET_ARTICLE = gql`
query getArticles(
$pageSize: Int = 100
$page: Int = 0
$sort: [String] = ["createdAt:desc"]
$filters: ArticleFiltersInput = {}
) {
articles(
@JulienHe
JulienHe / typescript-typedefs.js
Created September 5, 2022 02:06
Typedefs plugin
const { printSchema } = require("graphql");
module.exports = {
plugin: (schema, documents, config) => {
const theSchema = printSchema(schema).replaceAll("`", "");
return [
"const typeDefs = /* GraphQL */ `",
theSchema,
"`;",
"export default typeDefs;",
@JulienHe
JulienHe / graphql-executable.tsx
Last active September 5, 2022 01:46
Graphql Executable
import { makeExecutableSchema } from "@graphql-tools/schema";
import typeDefs from "./typedefs";
import mockArticle from "~/graphql/mock/article";
const executableSchema = makeExecutableSchema({
typeDefs,
resolvers: {
Query: {
articles: () => mockArticle,
@JulienHe
JulienHe / GraphQLClient.tsx
Created September 5, 2022 01:25
GraphQLClient
import { ApolloClient, InMemoryCache } from "@apollo/client";
import { SchemaLink } from "@apollo/client/link/schema";
import schema from "~/graphql/graphql-executable";
const GraphQLClient = new ApolloClient({
cache: new InMemoryCache(),
link: new SchemaLink({ schema }),
});
export default GraphQLClient;
@JulienHe
JulienHe / index.js
Last active August 16, 2022 17:00
Resize / Rename
const rootImageFolder = './images/';
function cleanNaming(directory) {
return directory.replace(/\d{1,}\s/g, '').replaceAll(/-\s/g, '').replaceAll(/\s/g, '-').toLowerCase();
}
function renameImage(source, exportName) {
fs.rename(source, exportName, function(err) {
if ( err ) console.log('ERROR: ' + err);
log(clc.blue("Rename cover"))
@JulienHe
JulienHe / snacks.json
Created August 5, 2022 00:38
Snacks schema
{
"kind": "collectionType",
"collectionName": "snacks",
"info": {
"singularName": "snack",
"pluralName": "snacks",
"displayName": "Snack",
"description": ""
},
"options": {
@JulienHe
JulienHe / common.json
Last active March 5, 2022 16:54
English
{
"homepage": {
"tagline": "Stand With Ukraine",
"subtag": "Spread love, not war.",
"intro": "Stand with Ukraine Art is a way for anyone to show their support to Ukraine in a digital way on Social Network.\n We want peace, not war.",
"createYourOwn": "Create your own 🇺🇦❤️ "
},
"navigation": {
"information": "Information",
"help": "How can I help?"
@JulienHe
JulienHe / followers-function.js
Last active April 15, 2020 06:58
IG Followers
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
@JulienHe
JulienHe / mouthposition.js
Created December 9, 2019 06:42
Spark AR - Mouth Corner
/**
* Author: Julien Henrotte @julien_he
* Company: UltraSuperNew http://ultrasupernew.com/
*/
/**
* Modules
*/
const Scene = require('Scene');
const FaceTracking = require('FaceTracking');
{
"hosting": {
"public": "dist/public",
"rewrites": [
{
"source": "**/**",
"function": "app-next"
}
],
"predeploy": "yarn build-public"