- 📝 Add comment or doc
- 🎁 New feature.
- 🐛 Bug fix
- 💣 Breaking compatibility.
- ✅ Write test.
- 🔥 Remove something.
- 🍺 I'm happy like reduced code complexity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const state = { | |
} | |
const getters = { | |
} | |
const actions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdio.h> | |
void minprintf(char *fmt, ...); | |
void minprintf(char *fmt, ...) { | |
va_list ap; | |
char *p, *sval; | |
int ival; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
FILE *fp; | |
void filecopy(FILE *, FILE *); | |
char *prog = argv[0]; | |
if (argc == 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { | |
NSLog(@"beginning search..."); | |
@autoreleasepool | |
{ | |
NSFileManager *manager = [NSFileManager defaultManager]; | |
NSString *home = [@"~" stringByExpandingTildeInPath]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function ellipseInterpolation(x, y, radiusX, radiusY, startProgress = 0, clockwise = true) { | |
const dir = ( clockwise ? 1 : -1); | |
return function (t) { | |
t = (t + startProgress); | |
const radian = t * Math.PI * dir * 2; | |
return { | |
x: radiusX * Math.cos(radian) + x, | |
y: radiusY * Math.sin(radian) + y | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ping(server, port): | |
''' Check if a server accepts connections on a specific TCP port ''' | |
try: | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((server, port)) | |
s.close() | |
return True | |
except socket.error: | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://blog.stevenlevithan.com/archives/date-time-format | |
//http://stevenlevithan.com/assets/misc/date.format.js | |
/* | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
* MIT license | |
* | |
* Includes enhancements by Scott Trenda <scott.trenda.net> | |
* and Kris Kowal <cixar.com/~kris.kowal/> |
OlderNewer