Skip to content

Instantly share code, notes, and snippets.

View siisee11's full-sized avatar
🔴
The Climb

Jaeyoun Nam siisee11

🔴
The Climb
View GitHub Profile
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");
#ifndef _BLOOM_H_
#define _BLOOM_H_
#include <crypto/algapi.h>
struct sdesc {
struct shash_desc shash;
char ctx[];
};
/*
* 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
@siisee11
siisee11 / tmux.conf
Created March 14, 2020 08:56
Tmux setting
# 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 %
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>
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>
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`,
package main
import (
"errors"
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
@siisee11
siisee11 / not_good.go
Last active January 17, 2020 12:23
Deadlock
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)
@siisee11
siisee11 / exercise11.go
Created January 17, 2020 11:51
tour of go web crawler
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)