HTML form for file uploads
<!-- in templates/form.html -->
<form action="/upload" method="POST" enctype="multipart/form-data">
<input type="file" name="logo">
<button>Upload</button>
</form>| #List of *hopefuly* all nationalities in list an tuple format for each python copy/paste | |
| NATIONALITIES_tuple = ('Afghan', 'Albanian', 'Algerian', 'American', 'Andorran', 'Angolan', 'Antiguans', 'Argentinean', 'Armenian', 'Australian', 'Austrian', 'Azerbaijani', 'Bahamian', 'Bahraini', 'Bangladeshi', 'Barbadian', 'Barbudans', 'Batswana', 'Belarusian', 'Belgian', 'Belizean', 'Beninese', 'Bhutanese', 'Bolivian', 'Bosnian', 'Brazilian', 'British', 'Bruneian', 'Bulgarian', 'Burkinabe', 'Burmese', 'Burundian', 'Cambodian', 'Cameroonian', 'Canadian', 'Cape Verdean', 'Central African', 'Chadian', 'Chilean', 'Chinese', 'Colombian', 'Comoran', 'Congolese', 'Costa Rican', 'Croatian', 'Cuban', 'Cypriot', 'Czech', 'Danish', 'Djibouti', 'Dominican', 'Dutch', 'Dutchman', 'Dutchwoman', 'East Timorese', 'Ecuadorean', 'Egyptian', 'Emirian', 'Equatorial Guinean', 'Eritrean', 'Estonian', 'Ethiopian', 'Fijian', 'Filipino', 'Finnish', 'French', 'Gabonese', 'Gambian', 'Georgian', 'German', 'Ghanaian', 'Greek', 'Grenadian', 'Guate |
| # List of nationalities taken from Gist and Gem converted to yaml and translated: | |
| # - https://github.com/JomaMinoza/nationality | |
| # - http://www.codegist.net/code/rails-nationality-select/ | |
| # - https://gist.github.com/marijn/274449 | |
| # - https://gist.github.com/clawfire/5170433 (fr) | |
| # | |
| # Country: | |
| # - https://github.com/stefanpenner/country_select | |
| # - https://github.com/hexorx/countries/ | |
| # |
HTML form for file uploads
<!-- in templates/form.html -->
<form action="/upload" method="POST" enctype="multipart/form-data">
<input type="file" name="logo">
<button>Upload</button>
</form>| nationalities = ( | |
| ('Afghan', gettext('Afghan')), | |
| ('Albanian', gettext('Albanian')), | |
| ('Algerian', gettext('Algerian')), | |
| ('American', gettext('American')), | |
| ('Andorran', gettext('Andorran')), | |
| ('Angolan', gettext('Angolan')), | |
| ('Antiguans', gettext('Antiguans')), | |
| ('Argentinean', gettext('Argentinean')), | |
| ('Armenian', gettext('Armenian')), |
| <script type="text/javascript"> | |
| // This identifies your website in the createToken call below | |
| Stripe.setPublishableKey('da_key'); | |
| // ... | |
| </script> | |
| <script> | |
| jQuery(function($) { | |
| $('#form').submit(function(event) { | |
| var $form = $(this); |
| require "json" | |
| require "net/http" | |
| require "uri" | |
| # The standard library Net::HTTP module is a bit convoluted, but here is an example of a flexible | |
| # system for making different kinds of HTTP requests. To see some convenience methods you can | |
| # consult the docs: https://ruby-doc.org/stdlib-2.5.5/libdoc/net/http/rdoc/Net/HTTP.html | |
| class HttpConnection | |
| def get(url, params = nil) |
| <%= form_for contact do |f| %> | |
| <% if contact.errors.any? %> | |
| <div class="form-errors"> | |
| <div class="alert shadow-lg alert-error text-white"> | |
| Your form's got some errors | |
| </div> | |
| </div> | |
| <% end %> | |
| <%= f.text_field :name, placeholder: "Your first name", class: "input input-bordered w-full max-w-xs my-5" %> | |
| <%= inline_error_for(:name, contact) %> |
| #!/bin/bash | |
| # This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures | |
| # everything needed to deploy a production-ready PostgreSQL server. | |
| set -euo pipefail | |
| # --- AESTHETICS --- | |
| GREEN='\033[0;32m' |