Skip to content

Instantly share code, notes, and snippets.

@ratfactor
ratfactor / addition_decomp.nim
Created October 9, 2019 22:11
the new decomposition method of adding - 3rd grade
import os, strutils, math
if paramCount() < 2:
echo "Error: supply two integers"
quit(QuitFailure)
var a, b: int
var hundreds, tens, ones: int
try:

Keybase proof

I hereby claim:

  • I am ratfactor on github.
  • I am ratfactor (https://keybase.io/ratfactor) on keybase.
  • I have a public key whose fingerprint is 9365 7CD8 06A1 C1A5 63F8 7C4E FCD6 FB97 7B08 8B91

To claim this, I am signing this object:

@ratfactor
ratfactor / server.js
Created October 14, 2013 19:24
An example of using Mongoose for Node.js to implement a toy blog application in Node.js.
var mongoose = require('mongoose');
var postSchema = new mongoose.Schema({ title: String, body: String, date: Date });
var Post = mongoose.model('Post', postSchema);
mongoose.connect('mongodb://localhost/blog');
var db = mongoose.connection;
db.once('open', function(){ startServer(); });
function startServer(){
var connect = require('connect');