Skip to content

Instantly share code, notes, and snippets.

View isdampe's full-sized avatar

Richard Denton isdampe

View GitHub Profile
let theArray = [5, 9, 3, 15, 41, 2, 19];
function arrayShift(arr, idx) {
console.log("Starting array is");
console.log(theArray);
for (let i=idx; i<arr.length - 1; ++i) {
console.log("Step");
theArray[i] = theArray[i + 1];
console.log(theArray);
}
#include <iostream>
using std::cout;
int factorial(int n)
{
if (n > 1)
return n * factorial(n -1);
return n;
}
#include "stdio.h"
#include "stdlib.h"
typedef struct dyn_int_array
{
int *base;
unsigned long size;
} dyn_int_array;
dyn_int_array new_dyn_int_array()
#!/bin/sh
# pppd ip-up script for all-to-tunnel routing
# name of primary network interface (before tunnel)
PRIMARY=eth0
# address of tunnel server
SERVER=tunnel.example.com
# provided by pppd: string to identify connection aka ipparam option