Skip to content

Instantly share code, notes, and snippets.

View donaldevine's full-sized avatar
💭
crushing it

Donal Devine donaldevine

💭
crushing it
View GitHub Profile
@donaldevine
donaldevine / socket.c
Created November 11, 2019 00:23 — forked from nolim1t/socket.c
HTTP Request in C using low level write to socket functionality
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
@donaldevine
donaldevine / fibonacciwithmemo
Last active September 1, 2017 15:12
Fibonacci with Memoization O(2N)
var calc = {
fibonacci : function(n, memo) {
memo = memo || {};
if (memo[n]) return memo[n];
if (n === 0) {
return 0;
} else if (n === 1) {
return 1;
} else {