A Pen by Krishna Gupta on CodePen.
This file contains hidden or 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 Link from "next/link"; | |
import type { NextPage } from "next"; | |
import { BugAntIcon, MagnifyingGlassIcon, SparklesIcon } from "@heroicons/react/24/outline"; | |
import { MetaHeader } from "~~/components/MetaHeader"; | |
import { gql } from '@apollo/client'; | |
import { useQuery } from '@apollo/client'; | |
export const GET_MESSAGES = gql` | |
{ | |
messages(first: 10, orderBy: createdAt, orderDirection: asc) { |
Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!
The advantages of versions 0.8.*
over <0.8.0
are:
- Safemath by default from
0.8.0
(can be more gas efficient than some library based safemath.) - Low level inliner from
0.8.2
, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
This file contains hidden or 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 requests | |
import csv | |
# zip code api variables | |
API_URL = 'https://api.zip-codes.com/ZipCodesAPI.svc/1.0/CalculateDistance/ByZip?' | |
ZIPS = ["T5T 4J2", "J3V 5K1", "H9R 1C4", "G1V 2L1", "H7T 1C8", "H3B 5K4", "H3P 3E9", "J4Y 0L1", "H1M 1W9", "J1L 1K1", "G2K 1N4"] | |
# API Key | |
APIKEY = 'HIDDEN' |
This file contains hidden or 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
vrrp_script chk_nginx_service { | |
script "/usr/lib/keepalived/nginx-ha-check" | |
interval 3 | |
weight 50 | |
} | |
vrrp_instance VI_1 { | |
interface eth0 | |
state MASTER |
This file contains hidden or 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 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
status_zone example.com_80; | |
location / { |
- NGINX Plus repo setup and install instructions (https://cs.nginx.com/repo_setup)
- NGINX Open Source install instructions (http://nginx.org/en/docs/install.html)
- NGINX syntax highlighting in vim (https://gist.github.com/kmjones1979/e3580525801254844e3b3f57989cbd38)
- NGINX command line switches (https://nginx.org/en/docs/switches.html)
- NGINX directives index (http://nginx.org/en/docs/dirindex.html)
- NGINX variables index (http://nginx.org/en/docs/varindex.html)
This file contains hidden or 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 80; | |
server_name example.com *.example.com; | |
status_zone example_com_80; | |
location / { | |
proxy_pass http://backend; | |
} |
This file contains hidden or 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 8001; | |
listen 8002; | |
server_name example.com *.example.com; | |
status_zone backend_800X; | |
location / { | |
return 200 "This is a server listening on $server_addr:$server_port \n"; |
This file contains hidden or 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 8080; | |
server_name localhost example.com *.example.com; | |
location / { | |
return 301 /status.html; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { |