Skip to content

Instantly share code, notes, and snippets.

View antico5's full-sized avatar

Armando Andini antico5

  • Santa Fe, Argentina
View GitHub Profile
@antico5
antico5 / italian_verbs.json
Created February 24, 2024 19:15
italian verbs
{
"essere": {
"meaning": "ser/estar",
"score": 1
},
"avere": {
"meaning": "tener/haber",
"score": 1
},
"fare": {
@antico5
antico5 / langapp.html
Created February 24, 2024 19:12
Language learning app - chatGPT generated
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Word Learning App</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
.container { max-width: 600px; margin: auto; }
input, button { padding: 10px; margin: 5px; }

0x024163a7bbfe1f02ddb5cfcf138e97b2d7e4a86d7f9f4abb2ecb0e8559d0e30e

[
{
"inputs": [
{
"internalType": "contract GPv2Authentication",
"name": "authenticator_",
"type": "address"
},
{
"internalType": "contract IVault",
@antico5
antico5 / catch_all.rb
Created March 13, 2019 15:31
catch-all action
get '*a', to: 'errors#error_404'
def error_404
if request.format.html?
render :error_404, status: 404
else
head 404, content_type: 'text/html'
end
end
@antico5
antico5 / postgresql.conf
Created July 23, 2018 14:43
postgres tweak for faster tests
```
# Turn off fsync; there is no need to flush data to disk.
fsync = 'off'
# Turn off full_page_writes;
# there is no need to guard against partial page writes.
full_page_writes = 'off'
# Increase checkpoint_segments and checkpoint_timeout ;
# this reduces the frequency of checkpoints,
@antico5
antico5 / install_dropbox.sh
Created July 5, 2018 18:04
install dropbox
#!/bin/bash
wget https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2015.10.28_amd64.deb -O dropbox.deb
sudo dpkg -i dropbox.deb
sudo apt-get install -f
dropbox start -i
@antico5
antico5 / js_linting.md
Created June 1, 2018 18:56
js linting

package.json

{
  "name": "project",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "prettier": "prettier app/**/*.js --write",
    "lint": "eslint app/**/*.js",
 "lint:fix": "npm run prettier &amp;&amp; npm run lint -- --fix"
@antico5
antico5 / update_joined_table.rb
Created May 18, 2018 14:02
Update on joined table PostgreSQL
Delivery.connection.update('UPDATE deliveries AS d SET customer_num = u.customer_num FROM users AS u WHERE d.customer_id = u.customer_id')
@antico5
antico5 / scope_with_nested_condition.md
Created March 2, 2018 17:14
scope_with_nested_condition.md
class Product < ApplicationRecord
  scope :active, -> { where(status: 'Active').where.not(inventory_cd: %w[NITRO DELIV]) }
end

class OrderLine < ApplicationRecord
  scope :with_active_product, -> { joins(:product).merge(Product.active) }
end