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
#!/bin/bash | |
trap 'handle_signal SIGINT' SIGINT | |
trap 'handle_signal SIGQUIT' SIGQUIT | |
trap 'handle_signal SIGTERM' SIGTERM | |
trap 'handle_signal SIGHUP' SIGHUP | |
trap 'handle_signal SIGKILL' SIGKILL # we can't handle this | |
handle_signal() { | |
echo "received: $1. Exiting..." |
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
/** | |
* React hook to execute an Apollo query and keep the data up to date according | |
* what's newest on the cache. | |
* | |
* @param { DocumentNode } query: the GraphQL query you want to run | |
* @param { Object } variables: the variables you want to interpolate on the query | |
* Note: you may want to memoize your object to prevent the query to run multiple times. | |
* | |
* Read more about param types on Apollo's watchQuery docs: | |
* https://www.apollographql.com/docs/react/api/apollo-client/#ApolloClient.watchQuery |
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
#!/usr/bin/env bash | |
# | |
# Managing notes with fzf (https://github.com/junegunn/fzf) | |
# - CTRL-L: List txt files in descending order by their modified time | |
# - CTRL-F: Search file contents | |
NOTE_DIR="${NOTE_DIR:-$(dirname "${BASH_SOURCE[0]}")}" | |
TRASH_DIR="$NOTE_DIR/trash" | |
export NORENAME=1 | |
cd "$NOTE_DIR" |
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
// For more information see: | |
// https://developers.google.com/web/updates/2017/09/abortable-fetch | |
// https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort | |
// https://caniuse.com/#search=fetch | |
const url = 'https://parrot.live'; | |
const controller = new AbortController(); | |
const signal = controller.signal; |
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
-- Thanks to: | |
-- https://coolaj86.com/articles/how-to-control-os-x-system-volume-with-applescript/ | |
-- https://robservatory.com/silently-mute-the-mic-input-via-applescript/ | |
-- https://macscripter.net/viewtopic.php?id=16588 | |
-- | |
-- For integration with the system see: http://eddmann.com/posts/creating-a-mac-microphone-mute-keyboard-shortcut/ | |
-- | |
-- In order to keep the `storedInputLevel` value you need to use it compiled: | |
-- $ osacompile -o toggle-mic.scpt toggle-mic.applescript | |
-- And then run: |
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>Hello World</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/3.1.4/antd.css"> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.min.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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello World</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
</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
#!/usr/bin/perl | |
# | |
# PackageApplication | |
# | |
# Copyright (c) 2009-2012 Apple Inc. All rights reserved. | |
# | |
# Package an iPhone Application into an .ipa wrapper | |
# | |
use Pod::Usage; |
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
#!/bin/bash | |
# Credit: | |
# original idea from https://github.com/rfairburn | |
clipboard() { | |
case "${OSTYPE}" in | |
linux*) | |
if which xsel &>/dev/null; then | |
xsel --input --clipboard |
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
#!/bin/sh | |
# file: docker-entrypoint-initdb.d/copy-config.sh | |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cp $SCRIPT_DIR/postgresql.conf /var/lib/postgresql/data/postgresql.conf |
NewerOlder