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
/** | |
* Takes a property path array, p, and a value, v, and returns an object to that spec. | |
* | |
* Example: | |
* objectify( ['foo', 'bar', 'baz'], [1, "42", {answer: 42}] ) | |
* | |
* Would return an object literal in the form: | |
* { | |
* foo: { | |
* bar: { |
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
// | |
// PopSheet.swift | |
// | |
// Adapted from: | |
// https://stackoverflow.com/questions/56910941/present-actionsheet-in-swiftui-on-ipad | |
// | |
import SwiftUI | |
extension View { |
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 SwiftUI | |
import UIKit | |
class ProximityObserver { | |
@objc func didChange(notification: NSNotification) { | |
print("MyView::ProximityObserver.didChange") | |
if let device = notification.object as? UIDevice { | |
print(device.proximityState) | |
} | |
} |
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 | |
set -e | |
if [ "Darwin" != $(uname) ]; then | |
echo "This script is currently only compatible with macOS" | |
exit 1 | |
fi | |
cd $HOME | |
curl https://gist.githubusercontent.com/skl/4dcf37c08a2c323c44e717840a8b4316/raw/226785983c0670e9bde5a7b5b311df04d57b6e2d/repair-sqlite-db.sh > repair-sqlite-db |
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 | |
set -e | |
function ph_is_installed() { | |
command -v $1 > /dev/null 2>&1 && return 0 || return 1 | |
} | |
if ! ph_is_installed sqlite3; then | |
if [ "Darwin" != $(uname) ]; then | |
echo "This script is currently only compatible with macOS" |
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
brew install pandoc homebrew/cask/basictex | |
# Add following to .bashrc or .zshrc for example | |
export PATH=/Library/TeX/texbin/:$PATH | |
# Use TeX Live Manager to install required packages missing from basictex | |
sudo tlmgr update --self && sudo tlmgr install tcolorbox environ trimspaces adjustbox collectbox ucs titling enumitem collection-fontsrecommended |
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
{ | |
"basic": { | |
"license key": "***REMOVED SENSITIVE VALUE***", | |
"date": "Thu, 22 Feb 2018 09:44:27 +0000", | |
"ownCloud version": "10.0.7.2", | |
"ownCloud version string": "10.0.7", | |
"ownCloud edition": "Community", | |
"server OS": "Linux", | |
"server OS version": "Linux ***REMOVED SENSITIVE VALUE*** 4.4.38-std-1 #1 SMP Mon Dec 12 10:45:29 UTC 2016 x86_64", | |
"server SAPI": "fpm-fcgi", |
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 | |
### BEGIN INIT INFO | |
# Provides: hostapd | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Should-Start: $network | |
# Should-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
; Initialise A/D multiplex register for internal temp. sensor (ADC8) | |
; Use internal (1.1V) as reference voltage and left-adjust | |
ADC_TempSensor_Init: | |
ldi r17, (1<<REFS1) | (1<<REFS0) | (1<<MUX3) | (1<<ADLAR) | |
sts ADMUX, r17 ; out of range for OUT, using STS instead | |
ret | |
; Reads ADCL into r21 and ADCH into r22 | |
ADC_TempSensor_Read: | |
; Enable ADC with a clock division factor of 128 (125 kHz) |
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
<?php | |
namespace Application; | |
use Zend\ModuleManager\ModuleEvent; | |
use Zend\ModuleManager\ModuleManager; | |
/** | |
* Class Module | |
* @package Application |
NewerOlder