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
Warden::Manager.serialize_into_session{|user| user.id } | |
Warden::Manager.serialize_from_session{|id| User.get(id) } | |
Warden::Manager.before_failure do |env,opts| | |
# Sinatra is very sensitive to the request method | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block | |
env['REQUEST_METHOD'] = "POST" | |
end | |
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
package OreOre::SQLMaker; | |
use strict; | |
use base qw(SQL::Abstract); | |
# $stmt = INSERT INTO table (col1, col2, col3) VALUES (?,?,?),(?,?,?) | |
# @bind = (val1, val2, val3, val21, val22, val23) | |
sub insert_multi { | |
my $self = shift; | |
my $table = shift; |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
Starman: | |
- Preforking standalone HTTP server | |
- Based on Catalyst::Engine::HTTP::Prefork by Andy Grundma | |
- Ported to Plack by Tatsuhiko Miyagawa | |
- Uses Net::Server::PreFork | |
- Supports HTTP/1.1 | |
- Pipelined requests | |
- Chunked request/response | |
- Keep-Alives | |
- Graceful restart with HUP (No shutdown with QUIT yet) |
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
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
head 'https://vim.googlecode.com/hg/' | |
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
version '7.3.682' | |
def features; %w(tiny small normal big huge) end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>jQuery Validation Pluginの簡単なサンプル</title> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js"></script> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> | |
<script>(function(){ | |
// 標準メッセージの上書き(日本語化等)とカスタム項目のメッセージを設定します。 | |
$.extend($.validator.messages, { | |
email: 'メールアドレスの形式で入力して下さい。(例: [email protected])', |
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
#!/usr/bin/env perl | |
package App::PSPrinter; | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Carp qw(croak carp); | |
use utf8; | |
use File::Basename; |
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
#!/bin/bash | |
condition="" | |
fs="\t" | |
while getopts c:F: OPT; do | |
case $OPT in | |
c ) condition=$OPTARG;; | |
F ) fs=$OPTARG;; | |
esac |
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
#!/bin/bash | |
usage() { | |
cat <<USAGE | |
usage: $(basename $0) [-p <param_name>=param_value] [-m <file_name>] [-x exectype] <script> | |
Execute the script with access to grunt environment. | |
-p <param_name - See parameter substitution for details. | |
-m <file_name> - See parameter substitution for details. | |
-x <exectype> - Set execution mode: local|mapreduce, default is mapreduce. | |
script - Script to be executed. |
OlderNewer