Skip to content

Instantly share code, notes, and snippets.

@AMACMA
AMACMA / google-docs-copy.js
Created March 9, 2022 07:32 — forked from Snarp/google-docs-copy.js
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
import java.util.*;
public class RocketFuel {
public static class Record {
int spaceshipId;
long time;
boolean isStart;
public Record(int spaceshipId, long time, boolean isStart){
this.spaceshipId = spaceshipId;
this.time = time;
@AMACMA
AMACMA / latency.markdown
Created October 10, 2016 01:37 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@AMACMA
AMACMA / Leetcode.md
Last active August 27, 2016 21:06
4.Median of Two Sorted Arrays

4. Median of Two Sorted Arrays


There are two sorted arrays nums1 and nums2 of size m and n respectively.

Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

In statistics, the median is used for dividing a set into two equal length subsets, that one subset is always greater than the other.

Trying to sync settings from different platforms.