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
$ curl http://localhost:9000/ | |
OK 200HTTP/1.1 Hello, World! | |
text/plain: Content-Type | |
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
$ ./1w | |
**** message begin **** | |
method: "GET" | |
uri: "/" | |
major: "1" | |
minor: "1" | |
field: "Host" | |
value: "localhost:9000" | |
field: "Connection" | |
value: "keep-alive" |
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
$ cat post.txt | ./1l | |
Input: | |
POST /cgi-bin/process.cgi HTTP/1.1 | |
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) | |
Host: www.tutorialspoint.com | |
Content-Type: text/xml; charset=utf-8 | |
Content-Length: length | |
Accept-Language: en-us | |
Accept-Encoding: gzip, deflate |
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
open Batteries | |
(**** symbols ****) | |
type symbol = | |
| Terminal of UChar.t | |
| Nonterminal of Text.t | |
let symbol_to_text = function | |
| Terminal char -> Text.of_uchar char |
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
(function() { | |
'use strict'; | |
var overlayVisible = 'overlay--visible'; | |
var $document = $(document); | |
$document.on('overlay:open', function() { | |
var $body = $('body'); | |
var $overlay = $('.overlay'); |
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
angular.module('app').controller('MainController', ['$scope', 'userResource', function($scope, userResource) { | |
$scope.current = {}; | |
$scope.$watch('current.user', function(user) { | |
if (user) { return; } | |
var user = userResource(); | |
user.then(function(user) { | |
$scope.current.user = user; | |
}); | |
}); | |
}]); |
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
angular.module('app', []) | |
.config(['$httpProvider', function($httpProvider) { | |
var csrfToken = $('meta[name="csrf-token"]').attr('content'); | |
$httpProvider.defaults.headers.common['X-CSRF-Token'] = csrfToken; | |
}]); |
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
<input type="datetime-local" datetime-picker ng-model="datetime" /> |
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
# ... | |
# Include specific models (exclude the others): | |
config.included_models = Dir.new(Rails.root.join('app', 'models')).entries.map{|entry| $1.camelize if entry =~ /^(\w+)\.rb$/ }.compact! + ['Doorkeeper::Application', 'Doorkeeper::AccessGrant', 'Doorkeeper::AccessToken'] | |
# ... |
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
class ApplicationController < ActionController::Base | |
# ... | |
before_filter :set_locale | |
# ... | |
def set_locale | |
logger.debug "* Accept-Language: #{request.env['HTTP_ACCEPT_LANGUAGE']}" | |
I18n.locale = locale_string(locale) if locale |