This file contains hidden or 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 (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
browserify: { | |
dist: { | |
files: { | |
'app.min.js': ['app.js'], | |
}, | |
options: { |
This file contains hidden or 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 div = $('.friends-item-list')[0]; | |
window.scrollTo(0, div.scrollHeight); |
This file contains hidden or 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
/// <reference path="../intellisense/browserlink.intellisense.js" /> | |
(function (browserLink, $) { | |
/// <param name="browserLink" value="bl" /> | |
/// <param name="$" value="jQuery" /> | |
function output(message) { // Helper for the 'greeting' function | |
if (console) { | |
console.log(message); | |
} |
This file contains hidden or 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
Install-Package Microsoft.AspNet.WebApi.Cors -pre -project WebService |
This file contains hidden or 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
void ValidateRequestHeader(HttpRequestMessage request) | |
{ | |
string cookieToken = ""; | |
string formToken = ""; | |
IEnumerable<string> tokenHeaders; | |
if (request.Headers.TryGetValues("RequestVerificationToken", out tokenHeaders)) | |
{ | |
string[] tokens = tokenHeaders.First().Split(':'); | |
if (tokens.Length == 2) |
This file contains hidden or 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 json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; | |
json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); |
This file contains hidden or 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
Rayui-MacBook-Pro:~ raykwon$ jitsu login --debug | |
info: Welcome to Nodejitsu jaykwon | |
info: jitsu v0.13.0, node v0.10.13 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command login | |
prompt: username: (jaykwon) jaykwon | |
prompt: password: | |
debug: { method: 'GET', | |
debug: uri: 'https://jit.su/auth', | |
debug: headers: |
This file contains hidden or 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
{ | |
"name": "gistcamp", | |
"version": "0.1.0", | |
"private": true, | |
"scripts": { | |
"start": "node server.js" | |
}, | |
"dependencies": { | |
"express": "3.2.4", | |
"ejs": "*", |
This file contains hidden or 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
// GET api/books | |
public IHttpActionResult Get() | |
{ | |
return Ok(_repository.GetBooks().AsEnumerable()); | |
} | |
// GET api/books/1 | |
public IHttpActionResult Get(int id) | |
{ | |
var book = _repository.GetBook(id); |
This file contains hidden or 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
[RoutePrefix("api/books")] | |
public class BooksController : ApiController | |
{ | |
// GET api/books | |
[Route("")] | |
public IEnumerable<Book> Get() { ... } | |
// GET api/books/5 | |
[Route("{id:int}")] | |
public Book Get(int id) { ... } |