Skip to content

Instantly share code, notes, and snippets.

View laktek's full-sized avatar

Lakshan Perera laktek

View GitHub Profile
var my_function_expression = function(){};
var mocked = nodemock.mock("foo").takes(20, my_function_expression).calls(my_function_expression, 30, [10, 20])
@laktek
laktek / gist:1631290
Created January 18, 2012 05:48
Wikipedia SOPA protest unmask
// If you need to unmask the Wikipedia's SOPA protest blackout,
// paste this in your browser's address bar.
javascript:(function(d){d.getElementById('mw-sopaOverlay').style.display='none'; d.getElementById('content').style.display='block';})(document);
var generate_tag_helpers_with_basepath = function(basePath) {
return {
relative_path: function() {
var pathDepth = basePath.split('/').length -2;
var path = new Array(pathDepth + 1).join('../');
return path;
}
}
};
package main
import (
"fmt"
"net/http"
"time"
)
/*
* Converts a function that return a channel
export default class App {
constructor(userHandler){
this.userHandler = userHandler;
}
async testing(req, res) => {
const { email } = req.body
const r = await this.userHandler.findOne({email})
res.json(r)
}
@laktek
laktek / server.js
Last active June 21, 2017 15:06 — forked from zellwk/server.js
const express = require('express')
const bodyParser = require('body-parser')
const expressValidator = require('express-validator')
const routes = require('./routes')
const middlewares = require('./middlewares')
const errorHandlers = require('./middlewares/errorHandlers')
const isProduction = process.env.NODE_ENV === 'production'
const passport = require('passport')
const mongoose = require('mongoose')
Verifying my Blockstack ID is secured with the address 1BStSSHb6QbagrSqSuWrX64yibNNdM8hd4 https://explorer.blockstack.org/address/1BStSSHb6QbagrSqSuWrX64yibNNdM8hd4