When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
Just create a new InterceptHandler and add it to your app. Different settings should be configured in your config file, so that it is easy to change settings.
Logging is then as easy as:
from loguru import logger
logger.info("I am logging from loguru!")
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
#!/bin/bash | |
IN=$1 | |
OUT=$2 | |
true ${SD_PARAMS:="-55dB:d=0.3"}; | |
true ${MIN_FRAGMENT_DURATION:="20"}; | |
export MIN_FRAGMENT_DURATION | |
if [ -z "$OUT" ]; then |
public MyService(WebClient.Builder builder){ | |
this.client = buildCustomWebClient(builder, "https://example.com"); | |
} | |
private SslContext createSSLContext() { | |
try { | |
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); | |
keyStore.load(getClass().getClassLoader().getResourceAsStream(KEYSTORE_FILE), KEYSTORE_PASSWORD.toCharArray()); | |
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509"); |
#!/usr/bin/python3 | |
import argparse | |
import logging | |
import subprocess | |
import os | |
import tempfile | |
from tempfile import mkstemp | |
import configparser | |
import gzip |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from flask import Flask, request | |
from urllib import unquote_plus | |
import json | |
import re | |
app = Flask(__name__) |
#!/bin/bash | |
LOGFILE=/tmp/backup-gitlab-to-s3.log | |
GITLAB_BACKUP_FOLDER=/var/opt/gitlab/backups | |
S3_FILE_PREFIX=gitlab | |
S3_BUCKET_PATH=bucket-name-goes-here/folder-here | |
SLACK_USERNAME="Backup Gitlab Daily - `hostname`" | |
SLACK_CHANNEL="#od-infra-monitoring" | |
SLACK_ICON="https://s3.amazonaws.com/kudelabs-archives/harddrive256.png" |
#!/bin/bash | |
# $1 = # of seconds | |
# $@ = What to print after "Waiting n seconds" | |
countdown() { | |
secs=$1 | |
shift | |
msg=$@ | |
while [ $secs -gt 0 ] | |
do | |
printf "\r\033[KWaiting %.d seconds $msg" $((secs--)) |
import { useState, useEffect } from 'react'; | |
import { StyleSheet, Text, TextInput, View, Button, FlatList } from 'react-native'; | |
import * as SQLite from 'expo-sqlite'; | |
const db = SQLite.openDatabase('coursedb.db'); | |
export default function App() { | |
const [credit, setCredit] = useState(''); | |
const [title, setTitle] = useState(''); | |
const [courses, setCourses] = useState([]); |