Skip to content

Instantly share code, notes, and snippets.

View newtonapple's full-sized avatar

David Dai newtonapple

  • Tobiko Data
  • San Francisco
View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 2, 2024 22:49
set -e, -u, -o, -x pipefail explanation
@newtonapple
newtonapple / RankingDistances.ipynb
Created April 2, 2018 05:58 — forked from pilipolio/RankingDistances.ipynb
Experiments based on paper "Generalized distances between rankings" by Kumar and Vassilvitskii.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Tarliton
Tarliton / async_sqlalchemy_thread.py
Last active February 26, 2023 13:07
asyncio with a thread executor and sqlalchemy
import asyncio
import base64
import os
import random
from sqlalchemy import Column, Integer, String
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker, declarative_base
# SQLAlchemy==2.0.4
@posener
posener / go-shebang-story.md
Last active June 28, 2024 21:18
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@cam8001
cam8001 / vort3x.md
Last active September 1, 2023 18:31
Vortex / IKBC Pok3r keyboard guide for Mac OS
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active June 25, 2024 07:29
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@newtonapple
newtonapple / job_control_zsh_bash.md
Created July 14, 2016 17:41 — forked from CMCDragonkai/job_control_zsh_bash.md
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents