rtl-sdr build notes for OSX
- based on notes from https://gist.github.com/jheasly/9477732
- using macports http://www.macports.org/
- see http://sdr.osmocom.org/trac/wiki/rtl-sdr
#!/bin/sh | |
## simple server health checker. when the service does not respond it calls a | |
## Discord or Slack webhook | |
## adjust values below according to you needs: | |
server=www.google.com | |
service=discord | |
webhook_url="https://discordapp.com/api/webhooks/...." |
#!/bin/sh | |
## Checks to see if the package.json changed following a checkout or merge and then automatically | |
## runs `npm install`. If you use yarn or pnpm, then change the line with `npm install` as needed. | |
## | |
## add this code to both .git/hooks/post-checkout and .git/hooks/post-merge | |
file="package.json" | |
if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${file}" | wc -l) -gt 0 ]] | |
then |
/** | |
* This module provides a set of async friendly functions that | |
* mirror the non-async versions in array. | |
* | |
* They are not necessarily optimised, but they do work when we | |
* need to deal with async or promise based operations in the | |
* handler. | |
*/ | |
/** |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>502 Bad Gateway</title> | |
<!-- Browser icons from https://github.com/alrra/browser-logos --> | |
#!/bin/sh | |
project=myapp | |
repo_path=~/repositories/${project} | |
dist_path=~/repositories/${project} | |
deploy_dir=/usr/local/${project} | |
export env=prod | |
cd "${repo_path}" |
import { Request } from 'express'; | |
function isTrue(value) { | |
return ['1', 1, 'yes', 'true', 'on'].indexOf(value) > -1; | |
} | |
function booleanValue(value) { | |
if (value) { | |
return ['1', 1, 'yes', 'true', 'on'].indexOf(value) > -1; | |
} |
rtl-sdr build notes for OSX
// see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat | |
// see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | |
function formatField(text, length = 30) { | |
const textLen = text.length; | |
const padCount = length - textLen; | |
let newText = text + ' '; | |
for (let i=0; i<padCount; i++) { | |
newText += '.'; | |
} |
// Based logic on example for discovering properties here: https://stackoverflow.com/questions/31054910/get-functions-methods-of-a-class | |
// This takes a class instance and returns an object with the objects bound to the instance | |
// Written, mainly to see if it could be done to avoid having to do individual explcit binds when | |
// registering with express router | |
function autoBind(instance) { | |
let obj = instance; | |
let props = [] | |
do { |
#!/bin/bash | |
# Simple 'pre-push' script to prevent an accidental push to a | |
# specific branch on a specific remote. Mainly needed when a | |
# remote branch is not protected. | |
# | |
# Place this in the .git/hooks folder of your project and then | |
# ensure you make it executable. Modify according to your needs. | |
restricted_branch=master |