Skip to content

Instantly share code, notes, and snippets.

View allmarkedup's full-sized avatar

Mark Perkins allmarkedup

View GitHub Profile
@allmarkedup
allmarkedup / buttons.css
Created July 29, 2026 23:48
Button with CSS property theme values
@theme {
--button-icon-size: 1em;
--button-border-radius: --spacing(11);
--button-border-width: 0;
--button-focus-ring-width: 2px;
--button-focus-ring-offset: 2px;
--button-focus-ring-opacity: 30%;
--button-opacity-disabled: 1;
--button-font-size: var(--text-sm);
--button-padding-block: --spacing(2);
@allmarkedup
allmarkedup / killport.sh
Created January 6, 2026 20:08 — forked from xdesro/killport.sh
Kill processes at a given port.
function killport {
echo '🚨 Killing all processes at port' $1
lsof -ti tcp:$1 | xargs kill
}
@allmarkedup
allmarkedup / Full-Markdown.md
Created November 22, 2025 23:03 — forked from allysonsilva/Full-Markdown.md
⚡️ Full Markdown Example

Headers

# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
@allmarkedup
allmarkedup / insert-missing-newlines.md
Last active September 8, 2025 17:19
Add missing trailing newline to all files in a git repo #codesnippet

Insert missing newlines into all files in git repo

git ls-files -z | while IFS= read -rd '' f; do if file --brief --mime-encoding "$f" | grep -qv binary; then tail -c1 < "$f" | read -r _ || echo >> "$f"; fi; done

Filter by extension type

@allmarkedup
allmarkedup / FractalPlugin.php
Last active August 26, 2021 15:10
Fractal component loader plugin for Craft cms
<?php
namespace Craft;
class FractalPlugin extends BasePlugin
{
public function init()
{
craft()->templates->getTwig()->setLoader(new FractalTemplateLoader());
@allmarkedup
allmarkedup / fractal.js
Created February 7, 2017 09:02
Export JSON map of Fractal @handle references to filesystem paths
const path = require('path');
const fs = require('fs');
const fractal = module.exports = require('@frctl/fractal').create();
function exportPaths() {
const map = {};
for (let item of fractal.components.flatten()) {
map[`@${item.handle}`] = path.relative(process.cwd(), item.viewPath);
}
fs.writeFileSync('components-map.json', JSON.stringify(map, null, 2), 'utf8');
@allmarkedup
allmarkedup / fractal.js
Created November 8, 2016 09:10
Fractal CLI command to export component templates with path rewrites
const fs = require('fs');
function exportTemplates(args, done) {
const app = this.fractal;
const items = app.components.flattenDeep().toArray();
const jobs = [];
for (const item of items) {
@allmarkedup
allmarkedup / fractal.js
Created October 11, 2016 09:40
Fractal + Twig
'use strict';
const twig = require('@frctl/twig');
const fractal = module.exports = require('@frctl/fractal').create();
fractal.set('project.title', 'Twig + Fractal');
/*
* Components
*/
@allmarkedup
allmarkedup / button.jsx
Created August 27, 2016 11:22
Example react component for fractal
import React, { PropTypes } from 'react';
const STYLE_PREFIX = 'c-button';
const Button = (props) => {
const buttonProps = {
className: `${STYLE_PREFIX}`,
disabled: props.disabled,
type: props.submit ? 'submit' : 'button'
};