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 Koa = require('koa'); | |
const mongoose = require('mongoose'); | |
// Excerpted from https://mongoosejs.com/docs/index.html | |
mongoose.connect('mongodb://localhost/test'); | |
var db = mongoose.connection; | |
db.on('error', console.error.bind(console, 'connection error:')); | |
db.once('open', function() { | |
// we're connected! | |
}); |
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
#!/bin/bash | |
# echoes '#!/bin/bash xdg-open "$1" &> $HOME/.xdg-open-error &' to /usr/sbin/open | |
echo -e "\043\041/bin/bash\n\nxdg-open \042\044\061\042 &> $HOME/.xdg-open-error &" > ozanmuyes-open | |
sudo mv ozanmuyes-open /usr/sbin/open | |
sudo chmod +x /usr/sbin/open | |
echo -e "\n# Mac OSX \047open\047 equivalent for Debian\nalias 'open'='/usr/sbin/open'" >> $HOME/.bashrc | |
. $HOME/.bashrc |
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 EventEmitter = require('events'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const DEFAULT_OPTIONS = { | |
chunkSize: 0, // in bytes, may be omitted | |
filename: '', // only renames the file, will not move - this should be done via `destFilepath` | |
// `filename` has precedence over `destFilepath`, in other words it renames destination file, if defined | |
}; |
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
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
#include "hash_table.h" | |
// TODO Write necessary function from http://apr.apache.org/docs/apr/1.4/group__apr__hash.html |
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> | |
#include <stdlib.h> | |
#define LEN 10000 | |
#define INF 30000 /* Larger than all other elements .*/ | |
// Use "$ time ./mergesort" command to measure execution time. | |
void merge(int *A, int p, int q, int r) { | |
int i, j, k, n1, n2, *L, *R; |
NewerOlder