Skip to content

Instantly share code, notes, and snippets.

use std::{io::BufReader, fs::File, borrow::Cow};
use serde::de::{DeserializeSeed, Visitor};
struct GrepDeserialize<'a, 'b> {
needle: &'a str,
cur_path: &'b mut String,
}
struct GrepVisitor<'a, 'b> {
/*
Copyright 2015 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
;; Package configs
(require 'package)
;;;; CODE:
(setq package-enable-at-startup nil)
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; Package configs
(require 'package)
;;;; CODE:
(setq package-enable-at-startup nil)
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
@unrealhoang
unrealhoang / par_sum_pow_mod.rs
Created February 24, 2019 01:42
Parallel sum
use std::thread;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Arc;
const MOD:u64 = 123456789;
// change to stack based for lower stack overhead
fn powmod(n: u64, p: u64, m: u64) -> u64 {
if p == 0 {
return 1;
.globl __ZN3nom6traits4star17h891dc8860874940bE
.p2align 4, 0x90
__ZN3nom6traits4star17h891dc8860874940bE:
Lfunc_begin34:
.loc 37 352 0
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
@unrealhoang
unrealhoang / keybase.md
Created October 5, 2017 02:39
keybase.md

Keybase proof

I hereby claim:

  • I am unrealhoang on github.
  • I am unrealhoang (https://keybase.io/unrealhoang) on keybase.
  • I have a public key whose fingerprint is ED57 FB62 0AAA F586 DE1F 2CC6 D1D9 41B0 4F73 E4FC

To claim this, I am signing this object:

class Api::Mobile::V1::GroupsController < Api::Mobile::V1::ApplicationApiController
acts_as_token_authentication_handler_for User
before_action :check_user_house_access
before_action :check_group_id, only: [:accept, :leave, :join]
before_action :check_user_group_access, only: [:accept, :leave]
#Todo: invite friends to group
(ns minesweeper.core
(:require [reagent.core :as reagent :refer [atom]]))
(def rows 30)
(def cols 30)
(def bombs 30)
(def mine-map (atom ()))
(def state-map (atom ()))
module A
module B
def self.hello
"hello root"
end
end
end
A::B.hello # => “hello root”
::A::B.hello # => “hello root”