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
module.exports = function (PassportUserCredential) { | |
/* | |
* Check if credentials already exist for a given provider and external id | |
* Enable this hook if credentials can be linked only once | |
* | |
* @param Loopback context object | |
* @param next middleware function | |
* */ | |
PassportUserCredential.observe('before save', function checkPassportUserCredentials(ctx, next){ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 $ = require('cheerio'), | |
_ = require('lodash'), | |
request = require('request'); | |
var url = 'http://www.themiamibikescene.com/search/label/stolen%20bike'; | |
request(url, function(err, resp, html){ | |
if(err){ | |
return console.log(err); | |
}; |
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 mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/app'); | |
var usrSchema = new mongoose.Schema({ | |
user: { type: String, required: true }, | |
password: { type: String, required: true }, | |
DLU: { type: Date } | |
}); | |
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
function SendDate(date){ | |
// Expecting date as string like '2013-08-08' | |
var temp; | |
date = date.split('-'); | |
temp = new Date(date); | |
// Returns '2013-08-19T04:00:00.000Z' | |
return temp.toISOString(); | |
} |
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
<cfouput> | |
<form method="POST"> | |
<input name="zipcode" type="number" placeholder="ZIP CODE" size="5" value="#(StructKeyExists(FORM,"zipcode") ? '#FORM.ZIPCODE#' : '')#"/> | |
<input type="submit" value="Search" /> | |
</form> | |
<cfif StructKeyExists(FORM,"zipcode") AND FORM.zipcode NEQ "" AND Len(FORM.zipcode) EQ 5> | |
<cfset theURL = "http://api.zippopotam.us/us/#FORM.zipcode#"> | |
<cfhttp url="#theURL#" method="get" result="response"></cfhttp> | |
<cfset temp = #DeserializeJSON(response.filecontent)#> |
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
export PS1="\[$(tput setaf 3)\] \u \[$(tput sgr0)\]at\[$(tput setaf 4)\] \H \[$(tput sgr0)\]in\[$(tput setaf 1)\] \W $ \n \[$(tput sgr0)\]" |
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
sudo npm install -g jitsu | |
jitsu login | |
vim package.json | |
{ | |
"name": "CHANGE_ME", | |
"subdomain": "CHANGE_ME", | |
"description": "CHANGE_ME", |
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
First, create a directory on your server and initialize an empty git repository. I like to serve my websites from ~/www/, so that's what I'll do in this example. | |
mkdir ~/www/example.com && cd ~/www/example.com | |
git init | |
Next, let's set up your server's git repo to nicely handle deployment via git push. | |
git config core.worktree ~/www/example.com | |
git config receive.denycurrentbranch ignore | |
Finally, we'll set up a post-receive hook for git to check out the master branch so your web server can serve files from that branch. (Remember, ^D is Control+D, or whatever your shell's EOT character is. |
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
Module.directive('ng-blur', function() { | |
return { | |
restrict: 'A', | |
link: function postLink(scope, element, attrs) { | |
element.bind('blur', function () { | |
scope.$apply(attrs.ngBlur); | |
}); | |
} | |
}; | |
}); |
NewerOlder