This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.
- Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
#!/usr/bin/env bash | |
# Builds mpv & mpv.app on Apple silicon Macs. | |
# Run this script from the root directory of the mpv repo. | |
# if anything fails, gtfo | |
set -ex | |
meson setup build | |
meson compile -C build |
import React, { useEffect, useState } from "react"; | |
import { ethers } from "ethers"; | |
import './App.css'; | |
import wavePortal from './utils/WavePortal.json'; | |
const App = () => { | |
const [currentAccount, setCurrentAccount] = useState(""); | |
const [allWaves, setAllWaves] = useState([]); | |
const contractAddress = "0xd5f08a0ae197482FA808cE84E00E97d940dBD26E"; |
#!/usr/bin/env bash | |
# | |
# Setup automatic sync from a Github upstream repository to a fork | |
# - a branch "actions" will be created (or re-used) to hold the Github action to run | |
# - sync is done each hour | |
# - branch 'actions' needs to be the default branch of your fork (=> settings) | |
# - the script is able to both create and update and rewrite the sync script if you modify this script file | |
# | |
# Author: Mathiue Carbou |
type FilterOperator = 'AND' | 'OR'; | |
type FiltersBy<T> = { | |
[K in keyof T]?: (value: T[K]) => boolean; | |
}; | |
/** | |
* Factory function that creates a specialized function to filter | |
* arrays, by validating all filters (AND operator), | |
* or validating just one of the filters (OR operator). | |
* @param operator Method to validate all filters: AND, OR |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
# Send login notification to Pushover | |
# This goes into /etc/profile | |
if [ -n "$SSH_CLIENT" ]; then | |
TEXT="$(date): SSH login to ${USER}@$(hostname -f)" | |
TEXT="$TEXT from $(echo $SSH_CLIENT|awk '{print $1}')" | |
## Send to pushover | |
curl -s \ | |
-F "token=API_TOKEN" \ | |
-F "user=API_USER" \ |
# | |
# Pieci / 5 koncerti sound processing | |
# http://pieci.lv | |
# | |
# Author: Aigars Sukurs <[email protected]> | |
# Copyright: (C) 2013 130DB | |
# Licence: MIT | |
# | |
s = ladspa.gate(s, threshold = -60.0, attack = 0.15, hold = 1.0, decay = 200.0, range = -25.0) |
<?php | |
/** | |
* Please be aware. This gist requires at least PHP 5.4 to run correctly. | |
* Otherwise consider downgrading the $opts array code to the classic "array" syntax. | |
*/ | |
function getMp3StreamTitle($streamingUrl, $interval, $offset = 0, $headers = true) | |
{ | |
$needle = 'StreamTitle='; | |
$ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36'; |