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
# envがあると動いた | |
# Begin Whenever generated tasks for: app | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
0,30 * * * * /bin/bash -l -c 'cd /var/www/app/current && env bundle exec script/rails runner -e staging '\''PostScheduled.post(-15.minutes.from_now..15.minutes.from_now)'\'' >> log/cron.log 2>&1' | |
# End Whenever generated tasks for: app |
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
.mode tabs posts | |
.output /tmp/posts.tsv | |
select * from posts; |
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 |
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
<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
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
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
(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
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
$ 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 |