Skip to content

Instantly share code, notes, and snippets.

View furey's full-sized avatar
💭
🤓👋

James Furey furey

💭
🤓👋
View GitHub Profile
@wesbos
wesbos / logger.js
Created January 8, 2024 15:55
console.log line numbers in Node.js
// Use like this: node --import logger.js yourapp.js
import path from 'path';
const { log } = console;
[`debug`, `log`, `warn`, `error`, `table`, `dir`].forEach((methodName) => {
const originalLoggingMethod = console[methodName];
console[methodName] = (...args) => {
const originalPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (_, stack) => stack;
@sbinlondon
sbinlondon / synthwaveglow.md
Last active February 22, 2024 22:40
Get the synth wave glow theme working for VS Code on Mac

Get the synth wave glow working for VS Code on Mac

These notes are pretty much the same steps as the two extensions list, it's just that I had to collate them together because neither seems to list it fully in the proper order.

  1. Install Synthwave ’84/Synthwave + Fluoromachine theme on VS Code (I used the Fluoromachine one)

  2. Install Custom CSS and JS Loader

  3. Command + Shift + P to open command palette > "Preferences: Open settings (JSON)"

@davestewart
davestewart / helpers.js
Last active November 26, 2019 04:31
Vue "route helpers" example
/**
* Helper function to reduce boilerplate in route creation
*
* @param {string} path The route's path
* @param {object} page A page component definition
* @param {Function} page A function that returns a page import
* @param {string} page A string path to a file in the view/pages folder
* @param {object} attrs Any additional attributes
*/
export function route (path, page, attrs = {}) {
@sagalbot
sagalbot / Icons.vue
Last active February 10, 2022 13:12
Super lightweight implementation of @primer/octicons as a Vue component. ex) `<icon name="alert" />`
<script>
import icons from '@pimer/octicons';
export default {
functional: true,
render(createElement, { props }) {
return Object.hasOwnProperty.apply(icons, [props.name]) ? createElement('svg', {
domProps: { innerHTML: icons[props.name].path },
attrs: { ...icons[props.name].options },
}) : false;
@fergiemcdowall
fergiemcdowall / README.md
Last active June 19, 2024 02:14
How to use pandoc to generate HTML from GitHub-flavoured markdown

Here is a little recipe for generating html from github-flavoured markdown. CSS extracted and modified from https://github.com/sindresorhus/github-markdown-css on 22-05-2019. At some point this CSS will probably have to be updated, but for now it works.

  1. Install pandoc 2.x or higher

  2. Save github-markdown.css (below) to ´~/.pandoc/github-markdown.css´

  3. To convert a file called README.md (change as appropriate) run ´pandoc --standalone -c ~/.pandoc/github-markdown.css -f gfm -t html README.md´

@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@timacdonald
timacdonald / Builder.php
Last active April 19, 2019 23:09
Basic Search
<?php
namespace App\Builders;
use Illuminate\Database\Eloquent\Builder as BaseBuilder;
class Builder extends BaseBuilder
{
public function search($term, $attributes)
{
@computercam
computercam / vue.config.js
Created August 13, 2018 19:31
Vue CLI 3 Webpack cache busting
module.exports = {
chainWebpack: config => {
config.plugin('html').tap(args => {
args[0].hash = true
return args
})
}
}
<template>
<p>{{ greeting }} World!</p>
</template>
<script>
module.exports = {
data: function () {
return {
greeting: 'Hello'
}
@timacdonald
timacdonald / ContactIndexResponse.php
Last active February 9, 2023 21:48
Easily respond to content types and url extensions
<?php
namespace App\Http\Responses;
use App\Models\ContactType;
use App\Factories\CsvFactory;
class ContactIndexResponse extends Response
{
public function __construct($contacts)