Skip to content

Instantly share code, notes, and snippets.

@FlandreDaisuki
FlandreDaisuki / sum.js
Last active May 1, 2020 14:18
應該是最美的 currying sum
// ref: https://t.me/JavaScriptTw/52631
function sum(...args) {
const total = args.reduce((p, c) => p + c);
const sumFunc = sum.bind(null, total);
sumFunc.valueOf = () => total;
return sumFunc;
}
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file:

@gslin
gslin / nench.txt
Last active February 13, 2019 06:12
Linode (Dedicated 4GB) v.s. AWS (c5.large)
(Remove tee part)
root@localhost:~# (curl -s wget.racing/nench.sh | bash; curl -s wget.racing/nench.sh | bash) 2>&1
-------------------------------------------------
nench.sh v2018.04.14 -- https://git.io/nench.sh
benchmark timestamp: 2019-02-12 19:10:00 UTC
-------------------------------------------------
Processor: AMD EPYC 7501 32-Core Processor
CPU cores: 2
@edawson
edawson / fastq_splitter.sh
Last active February 5, 2019 14:07
Split a FASTQ (or pair) into 100K read splits using GNU split and pigz. Modified from an original script by @ekg.
first_reads=$1
second_reads=$2
ddir=$(dirname $first_reads)
obase_first=$(basename $first_reads .fastq.gz)
obase_second=$(basename $second_reads .fastq.gz)
splitsz=4000000
if [ ! -z ${first_reads} ] && [ -e ${first_reads} ]
@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@cs8425
cs8425 / README.md
Last active November 9, 2022 09:03
How to REAL install Remix OS on VirtualBox

How to REAL install Remix OS on VirtualBox

This is how to REAL install Remix OS on VirtualBox. rootfs could be writable!!!

Needs:

  • any linux liveCD iso file (Xubuntu here)
  • Remix OS iso file ("Remix_OS_for_PC_Android_M_32bit_B2016092201.iso" here)
  • VirtualBox

Go vs. Scala (Akka) Concurrency

A comparison from 2 weeks using Go.

Actors vs. Functions

Akka's central principle is that there you have an ActorSystem which runs Actors. An Actor is defined as a class and it has a method to receive messages.

@daicham
daicham / .gitlab-ci.yml
Last active May 3, 2023 07:05
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@jsturgis
jsturgis / dropbox.service.md
Last active June 24, 2022 09:30
ubuntu 15.04 dropbox systemd

Install Dropbox and python script, symlink python script to /usr/local/bin/dropbox and add to your path.

/etc/systemd/system/dropbox.service contents

[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox start'