Skip to content

Instantly share code, notes, and snippets.

View meerasndr's full-sized avatar
🔧
Tinkering

Meera Sundar meerasndr

🔧
Tinkering
View GitHub Profile

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@meerasndr
meerasndr / gqlproxy.js
Last active July 9, 2020 15:45
Proxy for GraphQL server
const { importSchema } = require('graphql-tools')
const { makeExecutableSchema } = require('graphql-tools')
const gql = require('graphql-tag')
const proxy = require('express-http-proxy');
const app = require('express')()
const http = require('http')
const { graphqlHTTP } = require('express-graphql');
const typeDefs = gql`
@meerasndr
meerasndr / epigrams-on-programming.md
Created September 16, 2020 07:33 — forked from camdez/epigrams-on-programming.md
Alan Perlis' "Epigrams on Programming"

Epigrams on Programming

Alan J. Perlis, Yale University

This text has been published in SIGPLAN Notices Vol. 17, No. 9, September 1982, pages 7 - 13. I'm offering it here online until ACM stops me.

The phenomena surrounding computers are diverse and yield a surprisingly rich base for launching metaphors at individual and group activities. Conversely, classical human endeavors provide an inexhaustible source of metaphor for those of us who are in labor within computation. Such relationships between society and device are not new, but the incredible growth of the computer's influence (both real and implied) lends this symbiotic dependency a vitality like a gangly youth growing out of his clothes within an endless puberty.

The epigrams that follow attempt to capture some of the dimensions of this traffic in imagery that sharpens, focuses, clarifies, enlarges and beclouds our view of this most remarkable of all mans' artifacts, the computer.

@meerasndr
meerasndr / go-with-tests.md
Last active January 10, 2024 18:35
Notes from Go with Tests
  • Write the test first -> Try and run the test -> Write the minimal amount of code for the test to run and check the failing test output -> Write enough code to make it pass -> Refactor
  • We must not neglect our test code in the refactoring stage
  • It is important to question the value of your tests. It should not be a goal to have as many tests as possible, but rather to have as much confidence as possible in your code base. Having too many tests can turn in to a real problem and it just adds more overhead in maintenance. Every test has a cost.
  • reflect.DeepEqual - useful for seeing if any two variables are the same. Caveat: It is not type safe. Compiles even if silly comparisons like array == string is done. https://golang.org/pkg/reflect/#DeepEqual

Notes from YDKJS (author: Kyle Simpson) - Book 1 - Up & Going

Values and Types

JS has typed values, not typed variables Built-in types:

  • Strings
  • Number
  • Boolean
  • Null and undefined
  • Object

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

My notes from attempting to read the Dynamo paper ( Dynamo: Amazon's Highly Available Key-value Store)

  1. Introduction
  2. Background
  3. Related work
  4. System Architecture
  5. Implementation
  6. Experiences and Lessons learned
  7. Conclusions

Buzzwords: Key-Value store, primary key, eventual consistency, CAP theorem, hinted handoff, consistent hashing, virtual nodes.

//This uses char* pointers. The same thing can be done using character arrays as well.
#include<stdio.h>
#include<stdlib.h>
void mystrcpy(char* first, char* second){
while(*first != '\0'){
*second = *first;
first++;
second++;
}
*C function*
int fact(int n){
if (n <= 1) return 1;
return n * fact(n-1);
}
--
*NASM code*
default rel
global _main
section .data
@meerasndr
meerasndr / kernel-dev.md
Created August 13, 2021 03:22 — forked from vegard/kernel-dev.md
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.