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
server { | |
listen 443; | |
server_name my.domain.com; | |
root /var/www/my.domain.com; | |
ssl on; | |
ssl_certificate /usr/local/etc/ssl/star.crt; | |
ssl_certificate_key /usr/local/etc/ssl/star.key; |
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
# This works | |
- name: Install unixODBC | |
command: sudo {{ item }} chdir="/tmp/{{ mysql_odbc_unixodbc_url | basename | replace('.tar.gz', '') }}" | |
with_items: | |
- ./configure --prefix=/usr/local | |
- make | |
- make install | |
# This _doesn't_ work | |
# Why doesn't the chdir option get recognized? |
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
/** | |
* Parses a string containing one or multiple JSON encoded objects in the string. | |
* The result is always an array of objects. | |
* | |
* @param {String} data | |
* @return {Array} | |
*/ | |
function parseJson(data) { | |
data = data.replace('\n', '', 'g'); |
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
# List directory contents | |
alias sl=ls | |
alias ls='ls -lAF --color=auto' | |
alias la='ls -AF' | |
alias ll='ls -al' | |
alias l='ls -a' | |
alias l1='ls -1' | |
alias _="sudo" |
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 | |
truncate /tmp/ping.log -s 0 | |
while true; do | |
if ! ping -I ppp0 -s 8 -c 1 8.8.8.8 &> /dev/null; then | |
date --rfc-3339=ns | tee -a /tmp/ping.log &> /dev/null | |
fi | |
sleep 30 | |
done |
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 | |
# Returns a UTC timestamp of the current date/time. | |
# Can provide an optional format that matches date(1) format | |
now() { | |
local format="${1:-"%s"}" | |
echo -n "$(date -u +"$format")" | |
} | |
# Extract the first element of a list. |
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
{ | |
"countries" : [ | |
{ | |
"code": "ZW", | |
"name": "Zimbabwe" | |
}, | |
{ | |
"code": "ZM", | |
"name": "Zambia" | |
}, |
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
(function(global) { | |
// Sample Calculators: | |
// http://www.pine-grove.com/Web%20Calculators/interest.htm | |
var startingBalance = 10000.00, | |
totalBalance = startingBalance, | |
apr = (17.5 / 100), | |
months = 11, | |
interest, | |
customMonthlyPayment = 1000, |
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
const { getStorybookUI } = require('@storybook/react-native') | |
const React = require('react') | |
const { useEffect, useState } = require('react') | |
const { Linking } = require('react-native') | |
const { URL } = require('react-native-url-polyfill') | |
export const StorybookUIWrapper = () => { | |
const [config, setConfig] = useState() | |
const [url, setUrl] = useState() |
NewerOlder