Skip to content

Instantly share code, notes, and snippets.

View fernandocanizo's full-sized avatar
🎃
Working from home

Fernando Lucio Canizo fernandocanizo

🎃
Working from home
View GitHub Profile
@niksumeiko
niksumeiko / mongoose-findOrCreate.js
Last active May 15, 2020 23:53
Mongoose schema static `findOrCreate` method in ES6/7 async/await syntax
import mongoose from 'mongoose';
let schema = new mongoose.Schema({
email: { type: String, required: true, unique: true },
password: { type: String, required: true }
});
schema.statics.findOrCreate = async (conditions, opt_attr) => {
let document = await User.findOne(conditions);
@kosh04
kosh04 / curl.lsp
Created August 2, 2011 07:46
[newLISP]libcurlライブラリを利用したサンプルコード -> [moved] https://github.com/kosh04/newlisp-curl
;;; curl.lsp -- libcurl for newLISP
;; ChangeLog:
;;
;; 2013-12-04 add function curl-get. add dylib (osx).
;; 2011-08-02 first commit.
;; Link:
;;
;; libcurl - API