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
// Hop-by-hop headers. These are removed when sent to the backend. | |
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html | |
var hopHeaders = []string{ | |
"Connection", | |
"Keep-Alive", | |
"Proxy-Authenticate", | |
"Proxy-Authorization", | |
"Te", // canonicalized version of "TE" | |
"Trailers", | |
"Transfer-Encoding", |
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
-----BEGIN PGP MESSAGE----- | |
hQIMAwAAAAAAAAAAAQ//RDJG8JGUO/wEd+3RKru/2s2n/9fU2nA84Z8OxZHZr/t1 | |
CToq95ZHRhM4m2wfi4BK0rdbZZy8/1tzRIkd6ISGJhFeYN1XlyCsEx/RDtoErieo | |
hF9F987xBbCHZexFRVN/MxgdPLEkYy1Jb9AARqz2isRYvU6yAhJI+HtdJsyxtIj/ | |
A6klq4A5DMlUjt6t2wIUN8O1HlGIXeC68Ms4CAjFlyvvoj2AvAHAi0di11NLkh0z | |
MxG/EGfbfrP2F0miOMXNI40z0DzoY7aXI+PYtR0aqRJoZl14MdqBKoTickclZJ+m | |
QGJaz+ei9UzU/+ldyp8hUFCaGtcduXKOWp7hjA/kTrWD2puTJBytfrJ7RmXH5jX0 | |
3n5Vd4zOe84CyRAwu8r3Fv/XAzDUewj/p/G7OEGKHG+wxoE4jx7jZ/PwuOgI8xPB | |
JhhBIBlS3lXoEdH5xS7SJnp82ekB1Dmes8TldfUMrvxLTCAJ22oK4cZW3YBEZb3o |
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
fn insert(&mut self, data: &str) { | |
if data < &self.payload { | |
match self.left { | |
Some(ref mut n) => n.insert(data), | |
None => self.set_left(Self::new(data)), | |
} | |
} else { | |
match self.right { | |
Some(ref mut n) => n.insert(data), | |
None => self.set_right(Self::new(data)), |
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
struct FRange { | |
val: f64, | |
end: f64, | |
incr: f64 | |
} | |
fn range(x1: f64, x2: f64, skip: f64) -> FRange { | |
FRange {val: x1, end: x2, incr: skip} | |
} |
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
#!/usr/bin/python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2013 <deanishe@deanishe.net>. | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2013-11-01 | |
# |
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
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
/* | |
* Checks if it's our target process | |
*/ | |
static int is_our_target_process(int pid) | |
{ |
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 { format } = require("date-fns"); | |
/** | |
* logger is a small tool to centralize the logging of the application | |
* [@params](/params) {String} src - this will be prefixed before each message. It can be any string | |
* that would be significant when you read them in the logs (often in this code base it's the name | |
* of the file from where the log is sent) | |
*/ | |
const logger = (src) => { | |
return { |
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
import { | |
Checkbox, | |
FormControl, | |
FormControlProps, | |
FormErrorMessage, | |
// FormLabel, | |
InputProps, | |
} from "@chakra-ui/core" | |
import React, { PropsWithoutRef } from "react" | |
import { useField } from "react-final-form" |
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
import NextHead from 'next/head' | |
import { useEffect, useRef, useState } from 'react' | |
export type LazyLoadCSSProps = { | |
href: string | |
} | |
let hydrated = false | |
const LazyLoadCSS: React.FC<LazyLoadCSSProps> = ({ href }) => { |
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
import React, { useCallback, useState } from "react"; | |
import "intersection-observer"; | |
import { useInView } from "react-intersection-observer"; | |
const isSsr = typeof window === "undefined"; | |
const universalBtoa = isSsr ? (str: string) => Buffer.from(str.toString(), 'binary').toString('base64') : window.btoa; | |
const isIntersectionObserverAvailable = isSsr | |
? false | |
: !!(window as any).IntersectionObserver; |