This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" to tell process "SystemUIServer" | |
set bt to (first menu bar item whose description is "bluetooth") of menu bar 1 | |
click bt | |
tell (first menu item whose title contains "AirPods van Rogerio") of menu of bt | |
click | |
tell menu 1 | |
if exists menu item "Connect" then | |
click menu item "Connect" | |
else | |
key code 53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -n -X PATCH https://api.heroku.com/apps/APP_NAME/formation \ | |
-d '{ | |
"updates": [ | |
{ | |
"type": "web", | |
"docker_image": "$(docker inspect registry.heroku.com/APP_NAME/web --format={{.Id}})" | |
} | |
] | |
}' \ | |
-H "Content-Type: application/json" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
const express = require('express'); | |
const React = require('react'); | |
const App = require('./transpiled/App.js').default; | |
const { renderToString } = require('react-dom/server'); | |
const server = express(); | |
server.get('/', (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = require("react"); | |
const ReactDOM = require("react-dom"); | |
const reducer = (state, action) => { | |
switch (action) { | |
case "INCREMENT": | |
return state + 1; | |
case "DECREMENT": | |
return state - 1; | |
default: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.config = | |
files: | |
javascripts: | |
joinTo: 'app.js' | |
stylesheets: | |
joinTo: 'app.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Microfrontends Homepage</title> | |
<link href="header" rel="import" async /> | |
<link href="products-list" rel="import" async /> | |
<link href="cart" rel="import" async /> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import './index.css'; | |
class Header extends HTMLElement { | |
attachedCallback() { | |
ReactDOM.render(<App />, this.createShadowRoot()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="cart-main"></div> | |
<script src="dist/bundle.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = Elm.Cart.embed(document.getElementById('cart-main')); | |
window.addEventListener('addToCart', (event) => { | |
app.ports.addToCartEvents.send(event.detail); | |
}, false); |