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 user = await isvalid(/* data */, | |
{ | |
type: Object, | |
schema: { | |
'username': { /* username validators */ }, | |
'password': { type: String, required: true, match: /* some regular expression */ }, | |
'password_repeated': { type: String, required: true } | |
}, | |
post: (obj) { | |
if (obj.password !== obj.password_repeated) { |
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
if (!String.prototype.toCase) { | |
Object.defineProperties(String.prototype, { | |
'toCase': { | |
value: function(type = 'camel') { | |
const seperators = { | |
'camel': '', | |
'pascal': '', | |
'snake': '_', | |
'domain': '.', |
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 express = require('express'); | |
const app = express(); | |
app.get( | |
'/', | |
async (req, res) => { | |
res.json(await something()); | |
}); |
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
// | |
// NSObject+NSObject_AssociatedObjects.h | |
// Created by Kristian Trenskow. | |
// | |
#import <Foundation/Foundation.h> | |
/** | |
Associated objects additions to `NSObject`. | |
*/ |
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
body, body:before, body:after, .site-wrapper { | |
background: transparent !important; | |
background-image: none !important; | |
} |
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
ofEnableBlendMode(OF_BLENDMODE_ALPHA); | |
ofEnableAlphaBlending(); | |
_internalImage.allocate(ofGetWidth(), ofGetHeight(), OF_IMAGE_COLOR_ALPHA); | |
_internalImage.setUseTexture(true); | |
_internalImage.setColor(ofColor(0, 0, 0, 0)); | |
_internalImage.bind(); |
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
var express = require('express'); | |
var app = express(); | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.get('/', function(req, res, next) { |