Skip to content

Instantly share code, notes, and snippets.

View madawei2699's full-sized avatar
🎯
Focusing

Dawei Ma madawei2699

🎯
Focusing
View GitHub Profile
{"sig":"88ae11887adbd14d4674995ee23f72a53deb49cce476c86bc0a4ee48a613ea59df5f78162b2745903cf8ae915cc96e5b61deec0fbbf07a4a358441eb7bb513f81","msghash":"07e1bd0588cf1efe24c1f320dce4081603ad40e772c25ffc3f15751d086d4e98"}
@madawei2699
madawei2699 / CodingAnytimeAnywhere.exs
Created December 28, 2018 06:14
Coding Anytime Anywhere
(for x <- [<<65>><>"ny"], y <- ~w(time where), do: x <> y)
|> Enum.reduce('Co'++~c(deing)--[101], &([&2|["\s"|&1]]))
|> IO.puts
@madawei2699
madawei2699 / fibonacci-algorithms-in-elixir.exs
Created September 19, 2019 14:40
fibonacci-algorithms-in-elixir
defmodule Benchmark do
def measure(function) do
function
|> :timer.tc
|> elem(0)
|> Kernel./(1_000_000)
end
end
defmodule Fibonacci1 do
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.1.2/mustache.min.js"></script>
<title>TODO++</title>
</head>
<body>
<script id="todo-list" type="x-tmpl-mustache">
import gensim
from gensim import corpora,models
from gensim.matutils import corpus2dense
from sklearn.metrics.pairwise import cosine_similarity
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
import datetime
@madawei2699
madawei2699 / bibtex.png
Created January 22, 2020 11:03 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
<script type='application/ld+json' class='yoast-schema-graph yoast-schema-graph--main'>
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://www.hallaminternet.com/#organization",
"name": "Hallam",
"url": "https://www.hallaminternet.com/",
"sameAs": [
@madawei2699
madawei2699 / populate_data.py
Created April 1, 2020 13:07
populate millions records into mysql database
from peewee import *
import uuid
import random
import string
from datetime import date, timedelta
db_name = 'db'
table_name = 'table'
db = MySQLDatabase(db_name, user='root', password='123456', host='localhost', port=3307)
@madawei2699
madawei2699 / Rx.java
Last active June 4, 2020 16:15
rx java parallel demo
public class Rx {
public static void main(String[] args) {
int threadNum = Runtime.getRuntime().availableProcessors() + 1;
ExecutorService executor = Executors.newFixedThreadPool(threadNum);
final Scheduler scheduler = Schedulers.from(executor);
Observable.range(1, 20)
.flatMap(x -> {
Observable<Integer> observableA = Observable.just(x).observeOn(scheduler).map(a -> {
System.out.println(Thread.currentThread().getName() + ": =observableA=> " + a);
return a;
@madawei2699
madawei2699 / custom.css
Last active October 16, 2024 08:51
logseq/custom.css
/*
/* Theme custom css start
/* https://raw.githack.com/dracula/logseq/master/custom.css
*/
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");
:root {
--background: #282a36;
--light-background: #343746;