Instantly share code, notes, and snippets.

View nodejs
curl -sL | sudo -E bash - \
&& sudo apt-get install -y nodejs
# My first script
echo "Hello $USER"
echo "Hey I am " $USER " and will be telling you about the current processes"
echo "Running processes list"
View copy.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
int main(int argc, int **argv) {
char ch;
FILE *source, *target;
char source_file[40], target_file[40];
View opendir.c
This example reads the contents of a root directory.
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
View fread.c
Author: Adrian Statescu <>
How does fread really work?!
The declaration of FREAD is as following:
size_t fread(void *ptr, size_t size, size_t nmem, FILE *stream)
There may or may not be any difference in performance. There is a difference in semantics.
fread(a, 1, 1000, stdin); -> attempts to read 1000 data elements each of which is 1 byte long
fread(a, 1000, 1, stdin); -> attempts to read 1 data element which is 1000 bytes long
View Combsort.c
#include <stdio.h>
#include <malloc.h>
#define FIN ""
typedef int (*Comparer)(int, int);
typedef void (*fnPtr)(int*, int, Comparer);
int sort_asc(int a, int b) {
View perianderOfCorinth.c
#include <stdio.h>
#include <malloc.h>
#define FIN ""
#define FOUT "algsort.out"
//pointer to function
typedef void (*fnPtr)(int*,int);
void combsort(int *p, int n) {
View erathostenes.cpp
#include <iostream>
#include <fstream>
typedef unsigned long ulong;
typedef unsigned int uint;
namespace Erathostenes {
ulong getCount(ulong n) {
View subsets.cpp
#include <iostream>
#include <fstream>
#include <vector>
#define FIN ""
#define FOUT "submultimi.out"
using namespace std;
int main() {
View belongPointCircle.c
* Adrian Statescu <>
* Input -> n circle and one Point
* Output -> belong or not on disk.
#include <stdio.h>
#include <math.h>
#define SIZE 50
typedef struct TypePoint {