Skip to content

Instantly share code, notes, and snippets.

View MartinMa28's full-sized avatar

Yilin Ma MartinMa28

  • Former SDE Intern at Intel and WePay
  • San Jose, Beijing
View GitHub Profile
@theagoliveira
theagoliveira / OSTEP.sh
Last active May 6, 2021 06:53
Download every OSTEP (Operating Systems: Three Easy Pieces) chapter
#!/bin/bash
#
# Author: Thiago Cavalcante
# github.com/theagoliveira
url="http://pages.cs.wisc.edu/~remzi/OSTEP/"
mkdir OSTEP
cd OSTEP
wget -O "00a Preface.pdf" "${url}preface.pdf"
@lesovsky
lesovsky / append-strings-with-snprintf.c
Created July 15, 2016 18:52
How-to append strings using snprintf (without strcat/strncat).
#include <stdio.h>
#include <string.h>
#define LOC_MAXLEN 13
int main (void)
{
char dest[LOC_MAXLEN];
snprintf(dest, LOC_MAXLEN, "%s%s", "abc", "def");
@madan712
madan712 / IPRangeChecker.java
Created September 21, 2013 16:21
Java program to check IP address range. This is a simple java program to check IP address range. Here we provide a IP address to check whether it lies between start and end IP address.
import java.net.InetAddress;
import java.net.UnknownHostException;
public class IPRangeChecker {
public static long ipToLong(InetAddress ip) {
byte[] octets = ip.getAddress();
long result = 0;
for (byte octet : octets) {
result <<= 8;