Skip to content

Instantly share code, notes, and snippets.

  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@mookieblaylock
mookieblaylock / row_bom.txt
Created March 2, 2020 19:42
garbled_domains
2019-02-13,domains,https://uk.godaddy.com/domains,0.0,1.0,0.0,154.0,https://uk.godaddy.com/,worldwide,desktop,
# The following solution is used to enable GCLB with 1.0.x istio-on-gke add on.
#
# Ingress gateway in gke-add-on cannot be modified because it is reconciled.
#
# 1. Create a new ilgateway deployment with `--statusPort 15020`.
# 2. Create a new service of type 'NodePort` to point to the above deployment
# 3. In the target namespace, create a `gateway` resource to point to the ilbgateway by using
# `selector: { "istio": "ilgateway" }
# 4. Point k8s (GCLB) ingress resource to ilgateway
# 5. Add advanced health-check for GCLB
@peterroelants
peterroelants / mnist_estimator.py
Last active February 14, 2024 11:26
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@nikitakit
nikitakit / tf_beam_decoder.py
Last active January 6, 2024 08:48
Tensorflow Beam Search
"""
Beam decoder for tensorflow
Sample usage:
```
from tf_beam_decoder import beam_decoder
decoded_sparse, decoded_logprobs = beam_decoder(
cell=cell,
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active October 21, 2022 20:10
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@govert
govert / GpsUtils.cs
Last active March 25, 2024 08:43
Convert WGS-84 geodetic locations (GPS readings) to Cartesian coordinates in a local tangent plane (Geodetic to ECEF to ENU)
using System;
using System.Diagnostics;
using static System.Math;
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis.
// The implementation here is according to the paper:
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01.
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'"
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum
@mathias-brandewinder
mathias-brandewinder / MDL.fs
Last active November 20, 2019 13:59
Recursive minimal entropy partitioning, based on Fayyad & Irani: break a continuous variable into discrete intervals top-down, maximizing the entropy gained at each step, with a stopping rule using the Minimum Description Length principle.
namespace Discretization
// Recursive minimal entropy partitioning,
// based on Fayyad & Irani 1993.
// See the following article, section 3.3,
// for a description of the algorithm:
// http://www.math.unipd.it/~dulli/corso04/disc.pdf
// Note: this can certainly be optimized.
module MDL =
@copumpkin
copumpkin / gist:4759099
Last active December 12, 2015 10:29
zipWith/foldr challenge!
-- This is the type we're working with.
data List a = List (forall r. (a -> r -> r) -> r -> r)
-- Implement this signature. It should not be inefficient, so if you're planning
-- on writing something like tail (notoriously inefficient using foldr) on our
-- List type, think again! It should be possible to write with the same time
-- complexity as the original. And of course, converting to/from a conventional
-- list is cheating :)
zipWith :: (a -> b -> c) -> List a -> List b -> List c
@geoffreyanderson
geoffreyanderson / syncFilesystemToImage.sh
Created June 2, 2011 18:19 — forked from fairchild/bundle-to-ebs.sh
A script to rsync a running Linux OS to an image file (specifically, a 10GB image file for deployment to AWS EC2).
#!/bin/bash
# Run this script on a running Linux OS that you want to be put into an image file.
# Ensure that the system you run this on is less than 10GB in size if you wish to
# deploy the image file to AWS EC2.
# Note: This is based on Michael Fairchild's instance-to-ebs-ami.sh script.
# -https://gist.github.com/249915
imageFile=${1:-"awsImage-$(date +%m%d%y-%H%M).img"}
imageMountPoint=${2:-'/mnt/image'}
extraFilesArchive=${3:-'awsInstanceFiles.tar.gz'}