Skip to content

Instantly share code, notes, and snippets.

View tol-is's full-sized avatar
🏠
Working from home

Tolis C. tol-is

🏠
Working from home
View GitHub Profile
@tol-is
tol-is / pliim-turnOff.scpt
Created December 17, 2023 22:15 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@tol-is
tol-is / Build-and-Publish.md
Created December 15, 2022 23:24 — forked from OleksiyRudenko/Build-and-Publish.md
Building and publishing a web app @ github pages using ParcelJS
@tol-is
tol-is / assert.md
Created November 15, 2020 21:31 — forked from jamiebuilds/assert.md

assert() (sometimes called invariant())

Instead of checks like:

if (value === null) {
  throw new Error("missing value")
}
doSomethingThatNeedsValue(value)
// .filter(Boolean)
// .fitler to unique values
const fruit = ['Apple', 'Banana', 'Apple', 'Orange']
console.log(Array.from(new Set(fruit)))
const unique = (element, index, fullArray) => fullArray.indexOf(element) === index
console.log(fruit.filter(unique))
/*
@tol-is
tol-is / App.jsx
Created July 12, 2017 13:01 — forked from robertgonzales/App.jsx
How to make a custom Prompt (using getUserConfirmation) for React Router v4
// use Prompt like normal... magic happens in getUserConfirmation
class App extends Component {
render () {
return (
<Router getUserConfirmation={getUserConfirmation}>
{...}
<Prompt
when={formIsHalfFilledOut}
message="Are you sure you want to leave?"
/>