Skip to content

Instantly share code, notes, and snippets.

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

Daniel da Rocha danrocha

🏠
Working from home
View GitHub Profile
Modal
Display content in a layer above the main page. Ideal for confirmations, alerts, and forms.
Edit profile
<flux:modal.trigger name="edit-profile">
<flux:button>Edit profile</flux:button>
</flux:modal.trigger>
<flux:modal name="edit-profile" class="md:w-96 space-y-6">
<div>
4:50:01 PM:
[-] Skipping link rule
4:50:01 PM:
{
"code": 500,
"error": "Script generated an unhandled asynchronous exception. Error code: ERR_INVALID_URL",
"details": "TypeError [ERR_INVALID_URL]: Invalid URL: undefined",
"name": "TypeError",
"message": "Invalid URL: undefined",
"stack": "TypeError [ERR_INVALID_URL]: Invalid URL: undefined\n at onParseError (internal/url.js:258:9)\n at new URL (internal/url.js:334:5)\n at _id (/data/io/node12/d02ce6ef-d80d-4504-b6e5-240dceb06ef7/webtask.js:207:17)\n at fn (/data/sandbox/node12/node_modules/auth0-authz-rules-api/node_modules/async/lib/async.js:638:34)\n at Immediate._onImmediate (/data/sandbox/node12/node_modules/auth0-authz-rules-api/node_modules/async/lib/async.js:554:34)\n at processImmediate (internal/timers.js:461:21)\n at process.topLevelDomainCallback (domain.js:138:15)\n at process.callbackTrampoline (internal/async_hooks.js:124:14)"
{
"browserstackUserProfile": {
"data": {
"type": "browserstack-users",
"id": "8859201",
"attributes": {
"name": "Bhushan K",
"email": "bhushan.k+beb107@browserstack.com",
"username": "bhushank_WGweph",
"created-at": "2024-08-21T10:12:30.000Z",
const machine = Machine(
{
id: 'dropdown',
context: {
userAction: null,
},
initial: 'closed',
states: {
closed: {
on: {
const machine = Machine(
{
id: 'dropdown',
context: {
userAction: null,
},
initial: 'closed',
states: {
closed: {
on: {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@danrocha
danrocha / introrx.md
Created April 15, 2021 07:33 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@danrocha
danrocha / web-servers.md
Created January 30, 2021 09:11 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@danrocha
danrocha / flip.js
Created January 27, 2021 06:57
Flip function
const flip = function (originalArray, itemsToFlip) {
// array.map will always return a new array
// it goes through every item in the array and returns whatever you return
// in the logic for ach item
const flipped = originalArray.map((word) => {
// the array.find command returns the found item
// or returns undefined if the item is not found
// here i am trying to find the uppercase word in the list of items
// but because they are uppercase, i have to lowercase them
// when comparing to my original word
@danrocha
danrocha / machine.js
Last active November 27, 2020 15:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions