Skip to content

Instantly share code, notes, and snippets.

View mryap's full-sized avatar
💭
Seeking full-time employment

Mr. Yap mryap

💭
Seeking full-time employment
  • 08:57 (UTC +01:00)
View GitHub Profile
@jboner
jboner / latency.txt
Last active June 3, 2026 06:30
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
import numpy as np
import pandas as pd
import pandas.io.ga as ga
hosts = ['blog.example.com', 'www.example.com']
account_id = "12345678"
# construct a list of filters
# following the regex =~ contains syntax
# documented in the google API docs
@martijnvermaat
martijnvermaat / gitlab-ipython-notebook.md
Last active February 22, 2025 11:02
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active March 20, 2025 03:57
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benmarwick
benmarwick / 000-eScience_presentation.Rmd
Last active August 17, 2020 00:18
notes on docker and rstudio
# Reproducible Research using Docker and R
# Challenges of reproducibility
- dependencies
- isolation and transparency
- portability of computationational environment
- extendability and resuse
- ease of use

Useful Docker commands

The Basics

Build and tag an image from a Dockerfile :

docker build -t name/tag .

Run image:

with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active May 25, 2026 22:16
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@edwinallenz
edwinallenz / Dockerfile
Created November 17, 2015 15:46
Docker volume test
FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
@TutorialDoctor
TutorialDoctor / organize_files.py
Last active November 23, 2024 21:36
Automatically organize files and folders on your computer using python.
# Drop this folder in a directory and run it. It will organize all of your files into folder by first letter
# This was inspired by my mom (maybe you can relate?)
# This took much longer than I thought it would to figure this out, but I learned which modules are good for file handling.
# It took about an hour to come up with the base of the program, which organizes files by first letter or number
# I would like it to eventually recursively go into folders getting files and organizing them into folders.
# This was made using a straight ahead approach.
# For beginners, a directory is a folder.
# By the Tutorial Doctor
# Sun Dec 20 23:40:49 EST 2015
#------------------------------------------------------------------------------