Skip to content

Instantly share code, notes, and snippets.

@ryanrosello-og
ryanrosello-og / xstate playwright example.ts
Created July 15, 2022 11:35
xstate + playwright example
import { test, expect, Page } from '@playwright/test';
import { createMachine } from 'xstate';
import { createModel } from '@xstate/test';
let page: Page;
test.describe('Playwright document search', () => {
const documentationSearchMachine = createMachine({
id: 'documentSearch',
initial: 'idle',
states: {
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 4, 2025 02:21
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@zaceno
zaceno / hats-examples.md
Last active March 10, 2025 15:46
Typescript + Hyperapp examples

Hello World

import {h, text, app} from "hyperapp"

app({
  view: () => h('main', {}, text('text')),
  // cast to Node only if you're sure it exists
  node: document.getElementById('app') as Node,
})
{
"presets": ["next/babel", "@emotion/babel-preset-css-prop"],
"plugins": [
[
"prismjs",
{
"languages": [
"javascript",
"css",
"markup",
@dyrkin
dyrkin / wire_transfer.go
Last active June 28, 2021 13:37
Decomposed WireTransfer FSM definition
func whenInitial(wt *fsm.FSM) fsm.StateFunction {
return func(event *fsm.Event) *fsm.NextState {
transfer, transferOk := event.Message.(*Transfer)
if transferOk && event.Data == nil {
transfer.source <- transfer.amount
return wt.Goto(AwaitFromState).With(
&WireTransferData{transfer.source, transfer.target, transfer.amount, wt},
)
}
return wt.DefaultHandler()(event)
@tsukhu
tsukhu / Steps.md
Last active November 14, 2023 07:07
create-react-app with styled components

Here are the steps to convert the create-react-app generated to code to use styled components instead of css

  1. Created an app using create-react-app
create-react-app react-styledcomponents-app
  1. Install styled-components as a dependency
@DanDiplo
DanDiplo / JS-LINQ.js
Last active May 2, 2025 14:43
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@joyrexus
joyrexus / README.md
Last active May 17, 2021 19:41
Flickr public feed api