Skip to content

Instantly share code, notes, and snippets.

View farskid's full-sized avatar
🎯
Focusing

Farzad Yousefzadeh farskid

🎯
Focusing
View GitHub Profile
@tom-sherman
tom-sherman / shiki.tsx
Created April 15, 2023 13:03
Perfect syntax highlighting with Shiki and React Server Components in under 50 lines of code
import { getHighlighter as shikiGetHighlighter } from "shiki";
import { cache } from "react";
interface ShikiProps {
code: string;
lang: string;
theme: string;
}
export async function Shiki({ code, lang, theme }: ShikiProps) {
@steveruizok
steveruizok / render-state.js
Last active November 17, 2020 14:01
Render a State Designer state in the terminal.
import log from "ololog"
class Grid {
rows = []
width = 0
height = 0
chars = {
active: ["┌", "─", "┒", "┃", "┛", "━", "┕", "│"],
inactive: ["┌", "─", "┐", "│", "┘", "─", "└", "│"],
@mvalipour
mvalipour / playing-cards.css
Created January 3, 2019 20:51
Playing cards in CSS3
.pc { content: "\1F0A0"; font-size: 5em; line-height: 100%;}
.pc.suit-hearts,
.pc.suit-diamonds { color: indianred; }
.pc.suit-hearts.face-2:after { content: "\1F0A2" }
.pc.suit-hearts.face-3:after { content: "\1F0A3" }
.pc.suit-hearts.face-4:after { content: "\1F0A4" }
.pc.suit-hearts.face-5:after { content: "\1F0A5" }
.pc.suit-hearts.face-6:after { content: "\1F0A6" }
.pc.suit-hearts.face-7:after { content: "\1F0A7" }
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@developit
developit / *valoo.md
Last active November 13, 2023 08:39
🐻 Valoo: just the bare necessities of state management. 150b / 120b. https://npm.im/valoo

🐻 valoo

just the bare necessities of state management.

Usage

Hotlink it from https://unpkg.com/valoo.

See Interactive Codepen Demo.

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email carl.vitullo@gmail.com

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
@stephanbogner
stephanbogner / index.js
Created March 7, 2018 22:17
Create tree structure from paths array
var paths = [
["Account"],
["Account", "Payment Methods"],
["Account", "Payment Methods", "Credit Card"],
["Account", "Payment Methods", "Paypal"],
["Account", "Emails"],
["Account", "Emails", "Main Email"],
["Account", "Emails", "Backup Email"],
["Account", "Devices"],
["Account", "Devices", "Google Pixel"],
@morajabi
morajabi / ErrorBoundary.js
Last active November 22, 2020 00:46
React 16 Error Boundary component - for electron app (https://there.pm)
import React, { Component } from 'react'
class ErrorBoundary extends Component {
state = {
error: null,
hasError: false,
showError: false,
}
componentDidCatch(e) {
@lavshah
lavshah / instructions.txt
Created January 22, 2018 13:07 — forked from akashnimare/instructions.txt
Download Frontend Master courses video
# Requirements
* Python 2.7
* Google Chrome
* ChromeDriver - WebDriver for Chrome
- Download the latest chromedrive which is 2.28 from here - https://sites.google.com/a/chromium.org/chromedriver/downloads
- Extract and move `chromedriver` file to `/usr/local/bin/chromedriver`
- git clone https://github.com/li-xinyang/OS_FrontendMaster-dl
- cd OS_FrontendMaster-dl
@kentcdodds
kentcdodds / index.html
Last active June 24, 2021 19:48
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>