The document discusses Rack, a modular web server interface for Ruby that allows web applications and frameworks to be written as middleware stacks. It covers topics like Rack applications as middleware, common Rack middleware components, building applications with Rack and middleware, and integrating Rack middleware with frameworks like Rails.
How to avoid Benchmark Stuff ("BS") evaluating performance of code. This installment uses time to compare the execution speed of Perl and various shell commands, with and without plumbing.
The document discusses PSR-7, a PHP standard recommendation for representing HTTP messages. It proposes a set of interfaces for describing HTTP requests and responses in a standardized way. This includes interfaces for messages, URIs, requests, responses, streams, uploaded files, and bridges to existing frameworks like Symfony. The goal is to abstract HTTP messages in a practical way that supports both client and server applications.
The document provides an overview of advanced patterns in Flask including: 1. State management using application and request contexts to bind resources like databases. 2. Resource management using teardown callbacks to commit transactions and release resources. 3. Customizing response creation by passing response objects down a stack or replacing implicit responses. 4. Server-sent events for real-time updates using Redis pub/sub and streaming responses. 5. Separating worker processes for blocking and non-blocking tasks using tools like Gunicorn and Nginx. 6. Signing data with ItsDangerous to generate tokens and validate user activations without a database. 7. Customizing Flask like adding cache bust
The document discusses using Python for ethical hacking and penetration testing. It provides reasons for using Python such as its ease of use, readable syntax, rich libraries, and existing tools. It then covers various Python libraries and frameworks used for tasks like reconnaissance, scanning, exploitation, and packet manipulation. Specific topics covered include file I/O, requests, sockets, scapy, and more.
A gentle introduction to Observability and how to setup a highly available monitoring platform across multiple datacenters. During this talk we will investigate how we can setup and monitor an monitoring setup across 2 DCs using Prometheus, Loki, Tempo, Alertmanager and Grafana. monitoring some services with some lessons learned along the way.
Slides contain RESTful solutions based on Python frameworks like Flask and Django. The presentation introduce in REST concept, presents benchmarks and research for best solutions, analyzes performance problems and shows how to simple get better results. Finally presents soruce code in Flask and Django how to make your own RESTful API in 15 minutes.
This document discusses using an HTTP proxy to load specific web pages for testing purposes. It explains that many web pages contain resources from multiple domains that cannot be saved locally. An HTTP proxy can be used to intercept requests and redirect local URLs to a test server, while passing through external URLs to the actual web server. The document provides code examples for setting up an HTTP proxy using HTTP::Proxy and modifying the LWP user agent to handle local and remote URLs differently. Using this approach allows a test loop to load repeatable web page content from both local and external sources.
This document discusses client-server connections for a library application. It provides code for a CustomHttpClient class that defines methods for performing HTTP GET and POST requests. This includes setting connection timeout parameters. It also provides code for connecting to a MySQL database and inserting login credentials and book borrowing history. The code samples show how to connect between the client and server and interface with the backend database.
Puppet is an open source configuration management tool that can be used to automate the configuration and management of infrastructure and applications. It uses a client-server architecture and declarative language to define and enforce the desired state of systems. Other HashiCorp tools like Packer, Terraform, Vault and Nomad can integrate with Puppet for tasks like infrastructure provisioning, secrets management and workload orchestration. Bolt is a task orchestration tool from Puppet that can be used to automate operational tasks across infrastructure defined by tools like Terraform. Consul provides service discovery and configuration for the Puppet infrastructure.
Things like Infrastructure as Code, Service Discovery and Config Management can and have helped us to quickly build and rebuild infrastructure but we haven't nearly spend enough time to train our self to review, monitor and respond to outages. Does our platform degrade in a graceful way or what does a high cpu load really mean? What can we learn from level 1 outages to be able to run our platforms more reliably. We all love infrastructure as code, we automate everything ™. However making sure all of our infrastructure assets are monitored effectively can be slow and resource intensive multi stage process. During this talk we will investigate how we can setup and observe a service mesh platform using HashiCorp's Consul Connect by recording its metrics. logs and traces. This talk will focus on configuring and analysing the metrics, logs and traces Consul Connect produces using Prometheus, Loki, Tempo and Grafana.
"Roles and Profiles" is now the ubiquitous design pattern to create your puppet code tree. In this talk we will discuss writing reusable and maintainable profiles. We ll start by introducing creating module structures and will move on to type hinting and setting appropriate defaults. Finally we ll discuss the importance and the enforcing of code style conventions that allows multiple teams or projects to inner-source profiless
Day 1 of 7-days "JavaScript and Rich User Interfaces" training for my colleagues. It covers XMLHttpRequest, iframe, img cookie transport, script transport, JSONP, comet.
This document provides an overview of the history and development of Perl web development, introducing the Common Gateway Interface (CGI) model and its limitations. It describes how mod_perl helped address these issues but lacked portability. The PSGI specification and Plack implementation are presented as a solution, providing a common interface between Perl web applications and web servers. Key aspects of building PSGI applications, such as templates, user input handling, and middleware, are demonstrated. Major frameworks and servers supporting PSGI are also noted.
Why is blocking IO so bad? Why is non-blocking code with callbacks so bad? Here are a few ways to deal with both problems in Perl.
The document discusses using the Zend Framework to build web services. It covers exposing classes as SOAP, XML-RPC, and JSON-RPC web services. It also discusses building RESTful web services using the Zend Framework by implementing actions in a Zend_Rest_Controller and adding a Zend_Rest_Route. Code examples are provided for each approach.
The document discusses developing REST APIs with Python and Django Rest Framework (DRF). It explains the basics of REST, why it is used, and how to build a REST API with DRF including serializers, views, URLs, permissions, versioning, documentation, and testing. DRF allows building web APIs with Django that are highly configurable and have little boilerplate code. It also supports non-ORM data sources.
This talk was given at the Dutch PHP Conference 2011 and details the use of Comet (aka reverse ajax or ajax push) technologies and the importance of websockets and server-sent events. More information is available at http://joind.in/3237.
Grape is an API framework that provides a simple and consistent way to build APIs for Ruby applications. It allows developers to easily create REST-like APIs by defining endpoints and parameters within classes. Grape supports features like API versioning, parameter validation, multiple file structures, and endpoint documentation.
The document discusses Grape, an open-source Ruby framework for building REST APIs. Grape allows developers to quickly build RESTful APIs that are Rack applications. It includes features like authentication, error handling, logging, and works with Rails. The document provides an overview of Grape's features and capabilities for creating RESTful APIs in Ruby.
1) Grape is a framework for building REST-style APIs in Ruby. It is inspired by Sinatra and aims to make API development easy and intuitive. 2) With Grape, APIs can have their own framework separate from Rails or Sinatra. It allows for features like versioning, prefixing, namespacing, authentication helpers, and error handling in a concise syntax. 3) Grape focuses on ease of use but also plans to add more advanced features like documentation generation, content negotiation, OAuth support, plugin systems, and rate limiting to become a fully-featured API framework.
This document presents an overview of the Grape framework for building APIs in Ruby. It covers the basic usage of Grape, including versioning, formats, error handling, RESTful modeling, testing, documentation, and more. The goal of Grape is to provide a simple yet powerful framework for developing REST-style APIs in Ruby.
The document discusses Grape, an open-source Ruby framework for building REST APIs. Grape allows for the creation of REST-like APIs in Ruby in a more simplified way compared to other frameworks. It aims to make API development easier by removing entanglements from Rails APIs and reducing the manual work of Sinatra APIs. The document then covers various features of Grape like serialization, versioning, authentication and error handling.
The document discusses best practices for designing APIs, including using RESTful design with resources, separating the API into versions and modules, implementing authentication and authorization, and handling exceptions, caching, logging, instrumentation and performance. It also covers JSON formatting, CRUD operations, pagination, and documentation.
This document discusses JavaScript best practices and techniques. It covers topics like event handling, DOM manipulation, performance optimization, and progressive enhancement. Some of the key points made include: - Separate JavaScript code from HTML using script-based event handlers for readability and maintenance instead of inline handlers. - Consider event delegation and inline handlers only if script-based handlers cause responsiveness issues. - Use DOM or innerHTML methods for manipulating the DOM, favoring DOM for precision and innerHTML for bulk updates. - Combine and minify JavaScript files, use compression to reduce file size, and make scripts cacheable for better performance. - Support non-JavaScript users through progressive enhancement - build applications with
This document introduces Grape, an open-source Ruby framework for building REST-style web APIs. It discusses how to install Grape, create CRUD actions, add namespaces and versioning, validate parameters, add authentication, and support different API formats. It also compares the performance of Grape to Rails APIs, finding that Grape has a higher request throughput and lower latency. Resources for learning more about Grape include its Google Group, YARD documentation, and wiki.
This document provides an introduction to MERB (Modular, Elegant Resource-Based) and discusses several key concepts related to MERB including background processes, web services, embedded components, distributed applications, and the Rack middleware framework. The document is written in an informal tone and touches on many different topics at a high-level without going into detail on any single topic.
The document discusses Rack, a Ruby web server interface. It begins by explaining Rack's basic request/response cycle and common middleware components like Rack::Cache. It then covers integrating Rack into Rails applications and building custom middleware for tasks like exception handling and progressive caching. The document concludes by discussing some advanced Rack techniques and tools.
Rack provides a standard interface between web servers and web applications. It allows a web application to return a status, headers, and a body in response to an HTTP request. Middleware can be plugged into a Rack application to modify requests and responses. Popular Rack middleware includes Rack::Cache, Rack::Middleware, and Warden for authentication. In Rails, middleware is configured through an initializer and plugged into the middleware stack to run before or after other middleware.
Building a desktop app using HTTP::Engine as a micro web server, SQLite for data storage, and jQuery for the user interface. Comet and asynchronous workers are used to enable real-time features. JSON-RPC and routing are implemented to support AJAX actions. The combination provides a lightweight "desktop app" architecture that is cross-platform.
Sinatra is a lightweight web application framework for Ruby that provides a minimal DSL (Domain Specific Language) for building web apps. It relies on the Rack middleware specification to interface with web servers and keeps a minimal feature set, allowing developers flexibility. Key features include routing, parameters, filters, helpers, layouts, and the ability to test applications. Sinatra apps can be deployed on web servers using Passenger and a config.ru file.
You've heard of Zend's new framework, Expressive, and you've heard it's the new hotness. In this talk, I will introduce the concepts of Expressive, how to bootstrap a simple application with the framework using best practices, and finally how to integrate a third party tool like Doctrine ORM.
This document discusses the two main APIs used by WordPress - XML-RPC and AtomPub. XML-RPC uses XML over HTTP POST to transmit basic data types and allows for functions like metaWeblog.getPost. AtomPub uses HTTP methods to interact with Atom feeds and individual posts and comments. It provides a standardized way to interact with content repositories. The document also outlines tools for working with the WordPress APIs like the iPhone app and XML-RPC libraries for developers.
This document summarizes a talk about using Sinatra and RestClient for building lightweight web services and clients. Sinatra provides a simple and lightweight way to build web applications compared to full-featured frameworks like Rails. RestClient provides a simple way to make HTTP requests from client applications, offering more functionality than Net::HTTP but with less complexity than ActiveResource. Examples of Sinatra and RestClient use include a Git wiki application built in 355 lines of Ruby code and a Heroku client library.
The document discusses Satellite Apps, which allow integrating systems with JIRA Studio using remote APIs. Satellite Apps can be used for reporting, integration, and automation scenarios. Examples provided include using APIs to access issue details, create and modify pages, and automatically replace text in pages.
The document discusses Satellite Apps, which allow integrating systems with JIRA Studio using remote APIs. Satellite Apps can be used for reporting, integration, and automation scenarios. Examples provided include using APIs to access issue details, create and modify pages, and automatically replace text in pages.
An in-depth look at Sinatra and Rack, how they can be used to build web APIs, and some useful Rubygems and patterns for building complex Sinatra apps.
The document discusses API wrappers and why developers create them. Some key points: - API wrappers provide idiomatic and Ruby-like access to APIs for Ruby developers rather than using raw HTTP requests. - Wrappers can abstract away a complex API to simplify usage and provide a business domain model. - Popular Ruby libraries for creating wrappers include HTTParty, RestClient, Weary, and Faraday. These handle HTTP requests and parsing responses. - Middleware like Hashie and MultiJSON can be used to further Ruby-ify responses. - Wrappers insulate code from potential API changes and leverage API documentation.
You've heard of Zend's new framework, Expressive, and you've heard it's the new hotness. In this talk, I will introduce the concepts of Expressive, how to bootstrap a simple application with the framework using best practices, and finally how to integrate a third party tool like Doctrine ORM.
Based on original presentation by Dan Webb http://slidesha.re/dan_on_rack Added some bits about Rails at the end, instead of other examples he had originally.
The document provides an in-depth overview of PHP streams, including stream basics, input/output, filters, wrappers, transports, contexts, and examples of using streams for HTTP requests, FTP operations, and a hypothetical Twitter client. It explains how streams allow modification of data in-flight and provides built-in and custom wrappers for various protocols.
The document introduces dynamic languages and provides examples comparing Java and Groovy implementations of a filtering task. It discusses the benefits of Groovy, including its Java-like syntax, dynamic typing, built-in support for lists/maps/arrays, closures, and additional libraries that simplify APIs. Groovy aims to integrate well with Java while adding meta-programming capabilities. The document provides examples of common uses of Groovy and its features.
The document discusses scaling web applications built with Scala. It covers several Scala web frameworks like Unfiltered, Spray, Lift and Roundup that allow building scalable and high performance web services using Scala. These frameworks leverage Scala language features and the Actor model to build non-blocking and asynchronous applications that can scale to large numbers of concurrent users.
This document summarizes some new features in PHP 5.4: - Array syntax can now be written more concisely using square brackets instead of array functions. - PHP 5.4 includes a built-in web server for development purposes, allowing PHP scripts to be run without Apache. - Traits allow sharing of methods across classes to reduce code duplication, similar to mixins in Ruby. - Closures now support accessing properties of the enclosing class scope via $this.
Plack is a superglue for Perl web frameworks that provides a common interface called PSGI (Perl Web Server Gateway Interface) inspired by WSGI and Rack. PSGI allows any web application or framework to run on any web server by providing a standard way for applications to communicate with servers. Plack also includes tools like Plackup for running PSGI applications from the command line and middleware for common functionality that can be shared across frameworks. Many existing Perl web frameworks have been adapted to run under PSGI through Plack.
The document discusses various techniques for writing efficient JavaScript code, including: 1. Avoid premature optimization and focus on clean, correct code first. Optimization can then focus on specific bottlenecks. 2. Use language shortcuts like object and array literals instead of constructors to improve performance. 3. Cache frequently accessed values like DOM elements, styles, and function pointers to avoid repeated lookups. 4. Minimize DOM access and manipulation by batching changes and reducing the number of elements. 5. Use event delegation with event bubbling instead of attaching the same handler to many elements.
This document discusses using a Wii remote with Ruby code to create interactive programs. It provides an overview of the necessary hardware, libraries for connecting to the Wii remote from Ruby like WiiUseJRuby, and the Monkeybars GUI library. It also demonstrates example code for mapping button presses and motion data to methods, and includes demos of using the Wii remote for MIDI music and motion plotting. The document encourages an exploratory approach to programming with the Wii remote.
The document discusses the building blocks of modularity, including different types of connascence (ways that software elements are connected) such as connascence of name, position, meaning, algorithm, and execution. It advocates applying principles like the rule of locality, degree, and DRY (don't repeat yourself) to reduce strong connascence and increase loose coupling between modules. This improves modularity, reusability, and maintainability of software designs.
The document discusses outside-in development and behavior-driven development techniques. It provides examples of writing feature files with scenarios and steps, and creating corresponding step definitions to define the behavior. It also discusses structuring the test code, using fixtures/factories, and integrating with testing frameworks. The overall process involves writing scenarios, defining pending steps, implementing step definitions, refactoring code, and repeating.
The document discusses various topics related to systems building including testing code frequently, tribes throughout history, clouds and evolution. It mentions cracking the crystal of truth and using code to build infrastructure. The document encourages using one's powers for awesome and ends by providing contact information for questions.
This document discusses concepts related to living a fulfilling life through creativity and flow. It is divided into four sections: Discovery, discussing seeing with new eyes; Resistance, about overcoming obstacles to creative pursuits; Flow, explaining how flow states provide the most happiness; and Engagement, emphasizing managing one's energy across different domains. The overall message encourages finding fulfillment through creative challenges that match one's skills.
The document discusses various topics related to systems building including testing code frequently, tribes throughout history, clouds and evolution. It mentions cracking the crystal of truth and using code to build infrastructure. The document provides encouragement to use powers for awesome and asks if there are any questions. Contact information is provided at the end.
This document provides an overview and introduction to code reading skills and the RestClient library. It discusses why code reading is an important skill, introduces RestClient as a library for making HTTP requests, and provides examples of using RestClient to interact with Twitter's API. It also summarizes some other Ruby libraries and concepts discussed in the document like CSV, threading, and signal handling.
This document discusses the phc compiler for PHP. It begins with an introduction and motivation for compiling PHP. It then outlines the current state of phc, including challenges to compilation and phc's solution of using the PHP C API. The document discusses next steps for phc, including simple and advanced optimizations. It concludes by discussing experiences with using phc to compile PHP code.
The document discusses using Foreign Function Interface (FFI) to extend Ruby with C code. It describes defining a C struct for metrics similar to a Ruby Metric class, then binding the C functions that operate on the struct to Ruby via FFI. This allows metrics calculated by the C code to be accessed from Ruby while retaining performance compared to a pure Ruby implementation.
This document provides an overview of Sequel, a Ruby ORM and database toolkit. It discusses Sequel's history and key features, including database support, datasets, models, associations, and eager loading. Sequel aims to provide a clean Ruby API for building queries and interacting with databases while avoiding complexity where possible. It emphasizes features like connection pooling, functional-style datasets, and explicit association methods over proxies.