Ruby+Rails を始めるのにこの辺をおさえておくといいのでは。 というのを書いていきます。
Ruby
- 初めての Ruby 書籍
- リファレンスマニュアル
use strict; | |
use LWP::UserAgent; | |
my $app = do { | |
use Mojolicious::Lite; | |
get '/' => sub { shift->render(text => "Hello World") }; | |
get '/search' => sub { | |
my $self = shift; | |
my $foo = $self->param('q'); | |
$self->render(text => "You searched $foo"); |
# stuff setting up moose and the environment omitted | |
sub BUILD { | |
my $self = shift; | |
my $application_environment = $ENV{'APPLICATION_ENVIRONMENT'}; | |
my $conf = new Config::General($self->config_file); | |
my %config = $conf->getall; |
#include "apr.h" | |
#include "apr_strings.h" | |
#include "apr_lib.h" | |
#define APR_WANT_STRFUNC | |
#include "apr_want.h" | |
#include "ap_config.h" | |
#include "httpd.h" | |
#include "http_config.h" |
#!/bin/sh | |
set -e | |
HTTP_GET_COMMAND="" | |
if [ `which curl` ]; then | |
HTTP_GET_COMMAND="curl -L" | |
elif [ `which wget` ]; then | |
HTTP_GET_COMMAND="wget -O -" | |
elif [ `perl -v | grep "5.1[3-9]"` ]; then | |
HTTP_GET_COMMAND="perl -MHTTP::Tiny -e 'print +HTTP::Tiny->new->get(shift)->{content}'" |
package MyApp::Validator::Constraint; | |
use strict; | |
use warnings; | |
use FormValidator::Lite::Constraint; | |
=head1 SYNOPSYS | |
my $fv = FormValidator::Lite->new($q); | |
$fv->check( |
Ruby+Rails を始めるのにこの辺をおさえておくといいのでは。 というのを書いていきます。
Ruby
... | |
# Prometheus | |
config :prometheus, MyApp.PhoenixInstrumenter, | |
controller_call_labels: [:controller, :action], | |
duration_buckets: [10, 25, 50, 100, 250, 500, 1000, 2500, 5000, | |
10_000, 25_000, 50_000, 100_000, 250_000, 500_000, | |
1_000_000, 2_500_000, 5_000_000, 10_000_000], | |
registry: :default, | |
duration_unit: :microseconds |
user www-data; | |
#worker_processes 4; | |
#worker_priority 0; | |
#worker_cpu_affinity 0001 0010 0100 1000; | |
#worker_rlimit_nofile 163840; | |
#worker_processes 8; | |
#worker_priority 0; | |
#worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000; |
This project has moved to https://github.com/jonhoo/drwmutex so it can be imported into Go applications.
#!/usr/bin/env python | |
# coding: utf-8 | |
"""myprofiler - Casual MySQL Profiler | |
https://github.com/methane/myprofiler | |
""" | |
import os | |
import sys |