Created: Mar 19, 2020 4:37 PM Tags: Golang, Linux
- When you want to save some memory.
- When implementing a data set.
- When writing a seen hash
--with-file-aio \ | |
--with-http_addition_module \ | |
--with-http_sub_module \ | |
--with-http_dav_module \ | |
--with-http_flv_module \ | |
--with-http_mp4_module \ | |
--with-http_gunzip_module \ | |
--with-http_gzip_static_module \ | |
--with-http_random_index_module \ | |
--with-http_secure_link_module \ |
#https://stackoverflow.com/a/37300565 | |
until nc -z -v -w30 $MYSQL_HOST 3306 | |
do | |
echo "Waiting for database connection..." | |
# wait for 5 seconds before check again | |
sleep 5 | |
done |
Debouncing |
type badStates = | |
| ECONNREFUSED /* database not running, or running on different port */ | |
| SHUTTING_DOWN | |
| STARTING_UP | |
| ERROR(string); | |
let db_state = xs => ( | |
Js.String.includes("ECONNREFUSED", xs), | |
Js.String.includes("is shutting down", xs), |
let getMigrations: string => array(string) = | |
migrationsPath => Node.Fs.readdirSync(migrationsPath); | |
let readContent: string => string = | |
migrationFilePath => Node.Fs.readFileAsUtf8Sync(migrationFilePath); | |
let handleError = Js.String.make; | |
let countMigrations: | |
Postgres.client => Js.Promise.t(Belt.Result.t(int, Js.Promise.error)) = |
function FindProxyForURL(url, host) { | |
host = host.toLowerCase(); | |
if (shExpMatch(host, "*.nandomedia.com") || shExpMatch(host, "*.adobe.com")){ | |
return "SOCKS 127.0.0.1:1337"; // (IP:port) | |
} | |
return "default"; | |
} |
import React, { Component, useState, useEffect, useRef } from "react" | |
import BackgroundImage from "gatsby-background-image" | |
import style from "./index.module.css" | |
// props: data.allFile.edges[].node.childImageSharp.fluid | |
class BackgroundSliderMain extends Component { | |
state = { | |
current: 0, | |
edgeIndex: 0, |
from typing import Optional, List, Any | |
from marshmallow import Schema, fields, pprint | |
class Structure(object): | |
_fields = [] | |
def _init_arg(self, expected_type, value): | |
if isinstance(value, expected_type): | |
return value |
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom" xmlns:dc="https://purl.org/dc/elements/1.1/" | |
xmlns:content="https://purl.org/rss/1.0/modules/content" xmlns:newsmail="//"> | |
<channel> | |
<title>Daily Insider Newsletter</title> | |
<link>https://eprod.ncinsider.com/site-services/newsletters/daily-insider-newsletter/</link> | |
<atom:link href="https://eprod.ncinsider.com/feeds/fulltext/newsletter/daily-insider-newsletter" rel="self" type="application/rss+xml"></atom:link> | |
<description>Daily Insider Newsletter from the The Insider North Carolina State Government News Service newspaper in The Triangle.</description> | |
<language>en</language> |