Skip to content

Instantly share code, notes, and snippets.

View gist:6096628
exports.user = function (req, res) {
User.findById(req.params.id, function (err, user) {
if (err) {
res.send(err);
} else {
Friend.findOne({
userId: req.signedCookies.userid
}, function (err, user2) {
console.log('hit1');
console.log(user2);
@passcod
passcod / PKGBUILD
Last active Dec 17, 2015 — forked from anonymous/PKGBUILD
Fixed mongoose PKGBUILD (project moved to github)
View PKGBUILD
# Contributor: Leslie P. Polzer <polzer@gnu.org>
# Contributor: bender02 at archlinux dot us
# Contributor: Felix Saparelli <me@passcod.name>
pkgname=mongoose
pkgver=3.7
pkgrel=1
pkgdesc="Small and quick-to-use web server; https/php/cgi support"
arch=('i686' 'x86_64')
license=('MIT')
View index.html
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
<style>
nav#main a[data-current] { color: red; }
</style>
<nav id="main">
<a href="#!/">A</a>
<a href="#!/derp">B</a>
View LOLcryption.js
String.prototype.enlolcrypt = function (cipher) {
cipher = cipher || "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if ((new RegExp("["+cipher.substr(0,5)+"]")).test(T)) {
T = cipher[(i+2)%5];
} else {
T = cipher[(i+5)%21+5];
View LOLcryption.js
String.prototype.enlolcrypt2 = function () {
var cipher = "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if (/[aeoiu]/.test(T)) {
T = cipher[(i+2)%5];
} else {
T = cipher[(i+5)%21+5];
View timers-concat.json
{
"info": {
"title": "experiments",
"author": "forresto",
"description": "",
"url": "various-timers-%2B-concat",
"parents": [
"https://gist.github.com/3311840"
]
},
@passcod
passcod / parseUri.coffee
Created Apr 24, 2012 — forked from mrclay/UFCOE.parseUri.js
Parse a URI using the DOM
View parseUri.coffee
parseUri = (uri) ->
result = {}
a = document.createElement 'a'
props = 'protocol hostname host pathname port search hash href'.split ' '
a.href = uri
# Copy relevant properties
result[prop] = a[prop] for prop in props
@passcod
passcod / data-markdown.user.js
Created Nov 9, 2011 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
View data-markdown.user.js
// ==UserScript==
// @name *[data-markdown]
// @version 2.0
// @description Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/> and others
// @include *
// ==/UserScript==
// Contribs:
// Thaddee Tyl <http://espadrine.github.com/>