Skip to content

Instantly share code, notes, and snippets.

View Pagebakers's full-sized avatar

Eelco Wiersma Pagebakers

View GitHub Profile
@Pagebakers
Pagebakers / alpha.tsx
Last active February 23, 2024 14:23
Utility to transparentize Chakra UI color tokens
import { ThemeTypings } from '@chakra-ui/react'
/**
* Transparentize Chakra UI color tokens
* @param color - Chakra UI (semantic) token
* @param opacity - Opacity value 0 to 1.
*/
export const alpha = (color: ThemeTypings['colors'], value: number) => {
const key = color.replaceAll('.', '-')
return `color-mix(in srgb, var(--chakra-colors-${key}) ${Math.max(Math.min(value * 100, 100), 0)}%, transparent)`
{
"name": "saas-ui-pro-next-starter",
"version": "0.3.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
@Pagebakers
Pagebakers / Dockerfile
Created August 12, 2022 11:26
wundergraph-stack.ts
# Image layer for building the application
FROM --platform=linux/amd64 node:16 as build
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
WORKDIR /usr/src/app
# rebuild image when package.json or lock has changed
COPY package.json pnpm-lock.yaml .npmrc ./
import { ThemeTypings, useTheme } from '@chakra-ui/react'
export const useDefaultProps = <ThemeKey = keyof ThemeTypings>(
componentName: ThemeKey,
) => {
const theme = useTheme()
return theme.components[componentName]?.defaultProps || {}
}
@Pagebakers
Pagebakers / services.js
Last active May 26, 2021 15:29
A CLI script to test and deploy functions on Google Cloud Functions
#!/usr/bin/env node
/*
This CLI script makes it easy to manage, test and deploy
multiple functions/services in Typescript
Requirements
You will need the Google Cloud SDK installed and
authentication configured to support deployments.
@Pagebakers
Pagebakers / gist:3e288b46486c85fb70e9
Last active August 29, 2015 14:04
NodeJitsu Meteor deployment.

Install Jitsu

npm install jitsu -g

Install demeteorizer

npm install demeteorizer -g

Run demeteorizer

cd /your/meteor/path
demeteorizer -a nodejitsu-appname -n 0.10.x
{
"name": "portal",
"description": "portal.forwarder.nl - automatically converted by Demeteorizer. https://github.com/onmodulus/demeteorizer",
"version": "0.0.1-1",
"main": "main.js",
"scripts": {
"start": "node main.js"
},
"engines": {
"node": "0.10.25"
if(jQuery) (function($){
$.widget("pb.layout", {
_init : function() {
var o = this.options;
this.baseClass = '.' + this.widgetBaseClass + '-',
this._initPanels();
},