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
/* | |
* Copyright (C) 2013 Daniel Mack <daniel@zonque.org> | |
* Copyright (C) 2020 JY N <siisee111@gmail.com> | |
* | |
* Bloom filter implementation. | |
* See https://en.wikipedia.org/wiki/Bloom_filter | |
*/ | |
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
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
static int bloom_filter_init(void) | |
{ | |
unsigned char *data = "hihihellolowl"; | |
bool isIn; | |
int ret = 0; | |
bf = bloom_filter_new(1000); | |
bloom_filter_add_hash_alg(bf, "md5"); | |
bloom_filter_add_hash_alg(bf, "sha1"); | |
bloom_filter_add_hash_alg(bf, "sha256"); |
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
#ifndef _BLOOM_H_ | |
#define _BLOOM_H_ | |
#include <crypto/algapi.h> | |
struct sdesc { | |
struct shash_desc shash; | |
char ctx[]; | |
}; |
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
# remap prefix from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# split panes using | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % |
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 from "react" | |
import { css } from "@emotion/core" | |
import { Link, graphql } from "gatsby" | |
import { rhythm } from "../utils/typography" | |
import Layout from "../components/layout" | |
export default ({ data }) => { | |
return ( | |
<Layout> | |
<div> |
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 from "react" | |
import { graphql } from "gatsby" | |
import Layout from "../components/layout" | |
export default ({ data }) => { | |
const post = data.markdownRemark | |
return ( | |
<Layout> | |
<div> | |
<h1>{post.frontmatter.title}</h1> |
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 path = require(`path`) | |
const { createFilePath } = require(`gatsby-source-filesystem`) | |
exports.onCreateNode = ({ node, getNode, actions }) => { | |
const { createNodeField } = actions | |
if (node.internal.type === `MarkdownRemark`) { | |
const slug = createFilePath({ node, getNode, basePath: `pages` }) | |
createNodeField({ | |
node, | |
name: `slug`, |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and |
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
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. | |
Fetch(url string) (body string, urls []string, err error) |
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
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. | |
Fetch(url string) (body string, urls []string, err error) |