Skip to content

Instantly share code, notes, and snippets.

View fallenleavesguy's full-sized avatar
🌴
On vacation

fallenleavesbuy fallenleavesguy

🌴
On vacation
View GitHub Profile
@fallenleavesguy
fallenleavesguy / cat.c
Last active October 1, 2017 14:04
cat program in c
#include <stdio.h>
int main(int argc, char *argv[]) {
FILE *fp;
void filecopy(FILE *, FILE *);
char *prog = argv[0];
if (argc == 1)
@fallenleavesguy
fallenleavesguy / variable-arguments.c
Created September 16, 2017 15:36
variable-arguments in c
#include <stdarg.h>
#include <stdio.h>
void minprintf(char *fmt, ...);
void minprintf(char *fmt, ...) {
va_list ap;
char *p, *sval;
int ival;
@fallenleavesguy
fallenleavesguy / simple-grep.c
Last active September 10, 2017 16:35
simple grep in c
/**
* simple grep in c
*/
#include <stdio.h>
#define MAXLINE 1000
int getOneLine(char line[], int max);
int strindex(char source[], char searchfor[]);
char pattern[] = "ould";
@fallenleavesguy
fallenleavesguy / wc.c
Last active September 10, 2017 16:36
Word Count in c
/**
* simple word count in c
*/
#include <stdio.h>
#define IN 1
#define OUT 0
int main(int argc, const char * argv[]) {
int c, nl, nw, nc, state;
@fallenleavesguy
fallenleavesguy / vuex-modules.js
Created April 19, 2017 02:35
vue-common-snippets
const state = {
}
const getters = {
}
const actions = {
@fallenleavesguy
fallenleavesguy / Commit emoji convention.md
Created May 31, 2016 01:42
Commit emoji convention
  • 📝 Add comment or doc
  • 🎁 New feature.
  • 🐛 Bug fix
  • 💣 Breaking compatibility.
  • ✅ Write test.
  • 🔥 Remove something.
  • 🍺 I'm happy like reduced code complexity.