Skip to content

Instantly share code, notes, and snippets.

View JoshuaGross's full-sized avatar

Joshua Gross JoshuaGross

View GitHub Profile
@zmagg
zmagg / interview_prep.md
Last active August 17, 2023 22:14
How much prep did you do for the technical interviews?

How much prep did you do for the technical interviews?

I get asked this a lot so I thought I'd write it up to share. For context, I was interviewing for staff+ individual contributor roles at tech companies.

Technical Interviews

I was preparing to do some amount of live coding interviews, and some amount of pairing interviews.

Tech setup check-in

My friend Tom offered to do a pairing interview with me, which I also used to check my Zoom / screenshare setup. I screen shared from my 2019 XPS 13 for the pairing, but also had Zoom on an ipad for video/audio. I used Airpods for audio. This setup actually worked great, but it was nice to dial in some of the specifics--mic feedback from dialing in from two places, and just practice my schpiel about explaining what I was doing to the other person. Probably not useful for you unless you too, have Linux problems.

@kepano
kepano / obsidian-web-clipper.js
Last active May 10, 2024 01:34
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@kentcdodds
kentcdodds / README.md
Last active March 30, 2024 11:39
user-package-stats

user-package-stats

I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.

Feel free to try it yourself. Just change the username passed to getUserDownloadStats.

By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.

You can use it with npx like so:

@peterkhayes
peterkhayes / disjointSet.js
Created May 3, 2017 05:33
Javascript Disjoint Set
/*
Useful for HackerRank problems.
*/
function main (numNodes, edges) {
const parent = [];
const rank = [];
function makeSet (x) {
@rtoal
rtoal / JSFirst.md
Last active April 15, 2024 10:23
JSFirst

JS First

About This Manifesto

Have you ever argued for or against teaching language X as the first language in a university computer science curriculum? If so, I hope that your arguments:

  • were first and foremost about students, considering the question “What do we want students to gain from their experience with a first language?”, not “Is language X better than language Y?” because the latter question requires too much context and isn’t really answerable;
  • kept in mind that ultimately we want to train polyglots, so the first language is never the only language; and
  • took into account previous work from computing educators, and education theorists and practitioners in general.
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@teasherm
teasherm / s3_multipart_upload.py
Last active February 4, 2024 04:44
boto3 S3 Multipart Upload
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)
import org.apache.crunch.types.orc.OrcUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.io.orc.OrcFile;
import org.apache.hadoop.hive.ql.io.orc.OrcStruct;
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
import org.apache.hadoop.hive.serde2.io.ShortWritable;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
@jeffrafter
jeffrafter / cgimage.swift
Created February 9, 2017 00:34
Resizing CGImage in Swift 3
func resize(_ image: CGImage) -> CGImage? {
var ratio: Float = 0.0
let imageWidth = Float(image.width)
let imageHeight = Float(image.height)
let maxWidth: Float = 1024.0
let maxHeight: Float = 768.0
// Get ratio (landscape or portrait)
if (imageWidth > imageHeight) {
ratio = maxWidth / imageWidth
@suyash
suyash / client.c
Created January 2, 2017 16:36
TCP echo client-server in C
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
int main() {
const char* server_name = "localhost";
const int server_port = 8877;