gem "puma"
change to project directory
bundle install
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| <div data-paperform-id="jwps"></div> | |
| // Note: Please don't change/format the below line no 3. Keep as it is. | |
| <script>(function () { var script = document.createElement('script'); script.src = "https://paperform.co/__embed.min.js"; document.body.appendChild(script); })()</script> | |
| <script> | |
| (function () { | |
| const currentPageUrl = window.location.href; | |
| const form = document.querySelector("[data-paperform-id='jwps']"); | |
| // formsubmiturl is your custom Pre-fill key: | |
| form.setAttribute('prefill', "formsubmiturl=" + currentPageUrl); |
| //------ ROOT -------- | |
| root# apt-get update | |
| root# apt-get upgrade | |
| // Dependencies | |
| apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \ | |
| libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev \ | |
| libpcre3-dev unzip htop zip | |
| // Source: https://twitter.com/calebporzio/status/1151876736931549185 | |
| <div class="flex"> | |
| <aside class="h-screen sticky top-0"> | |
| // Fixed Sidebar | |
| </aside> | |
| <main> | |
| // Content | |
| </main> |
| <div class="form-group"> | |
| <%= form.label :type, "Type", class: "font-weight-bold" %> | |
| <%= form.select :type, ['TextQuestion', 'UrlQuestion'], { include_blank: true }, { class: "form-control", data: { action: "input->toggle#changed", target: "toggle.select" } } %> | |
| </div> | |
| <div class="form-group"> | |
| <%= form.label :name, "Name", class: "font-weight-bold" %> | |
| <%= form.text_field :name, class: "form-control" %> | |
| </div> | |
| <div class="form-group" data-target="toggle.element" data-values="UrlQuestion"> | |
| <%= form.label :url, "URL", class: "font-weight-bold" %> |
| <?php | |
| $countries = | |
| array( | |
| "AF" => "Afghanistan", | |
| "AL" => "Albania", | |
| "DZ" => "Algeria", | |
| "AS" => "American Samoa", | |
| "AD" => "Andorra", | |
| "AO" => "Angola", |
| #!/bin/bash | |
| set -e | |
| echo "> Removing certificate" | |
| sudo security delete-certificate -c localhost || true | |
| echo "> Generating .key" | |
| sudo openssl genrsa -out config/localhost.key 4096 |
Rails 4 is out featuring Russian Doll caching (AKA Cache Digests). In this article, I apply Russian Doll caching to one of my poorer performing Rails 3 pages using the cache_digests gem.
ActionView templates are great. They are easy to code, manage and extend but the one thing they are not is fast...at least not out of the box.
In this article, I'll be using AppNeta's TraceView to time ActionView performance. If you haven't used TraceView before, checkout my previous article Instrumenting Ruby on Rails with TraceView.
ActionView puts forth a great development pattern of views and partials that is easy to understand, implement and maintain but that comes at a cost: The rendering process is complex and slow.
| class ChangeProductLongDescription < ActiveRecord::Migration | |
| def up | |
| # simple and straightforward | |
| change_column :products, :long_description, :text | |
| end | |
| # but why cant it just be: | |
| # change_column :product, :long_description, :string | |
| # ??? | |
| # because effin databases don't like you, that's why. |