- You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use
rails newfirst to generate all of the boilerplate files necessary. - Create an app in the current directory with
rails new . - Use Tailwind CSS for styling. Use
--css tailwindas an option on therails newcall to do this automatically. - Use Ruby 3.2+ and Rails 8.0+ practices.
- Use the default Minitest approach for testing, do not use RSpec.
- Default to using SQLite in development.
rails newwill do this automatically but take care if you write any custom SQL that it is SQLite compatible. - An app can be built with a devcontainer such as
rails new myapp --devcontainerbut only do this if requested directly. - Rails apps have a lot of directories to consider, such as app, config, db, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Complete ZScaler installation script for Arch Linux | |
| # Confirmed to work with ZScaler 3.7.2 | |
| # Make sure the ZScaler .run file is in the current working directory. | |
| # The QT Dependencies take forever to install... make sure you've got enough battery! | |
| echo "Installing ZScaler on Arch Linux..." | |
| echo "=================================" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "strscan" | |
| class Scanner | |
| TOK = [] | |
| TOK["{".ord] = :LBRACE; TOK["}".ord] = :RBRACE; TOK[";".ord] = :SEMI | |
| def initialize data | |
| @scan = StringScanner.new data | |
| @prev_pos = @scan.pos | |
| end |
I hereby claim:
- I am apiguy on github.
- I am apiguy (https://keybase.io/apiguy) on keybase.
- I have a public key whose fingerprint is B007 ED9E C641 A8C8 BDAA 3EE0 1BAF 9671 E675 C159
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alert('wooot'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| time = .0 | |
| seconds = 0 | |
| while True: | |
| time += .1 | |
| seconds = int(time) | |
| print "---------------" | |
| print "Time to str: ", time | |
| print "Time to int: ", int(time) | |
| print "Seconds: ", seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import timeit | |
| setup = """ | |
| import re | |
| from itertools import ifilter | |
| x = "active" | |
| regex = re.compile(x, re.IGNORECASE) | |
| def uppertest(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def if_(value, truth_test): | |
| return value if truth_test else None | |
| # Usage | |
| """ | |
| {{ active|if_(row.first) }} | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # https://raw.github.com/gist/2776351/??? | |
| # chmod 777 install_postgresql.sh | |
| # ./install_postgresql.sh | |
| ############################################### | |
| echo "*****************************************" | |
| echo " Installing PostgreSQL" | |
| echo "*****************************************" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| redis_version=2.6.13 | |
| # from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
| # and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
| ############################################### | |
| # To use: | |
| # wget https://gist.github.com/apiguy/5669466/raw/952b5221f46db37d1cda8fb04c6a23356b9c6338/install-redis.sh | |
| # chmod +x install-redis.sh | |
| # ./install-redis.sh |
NewerOlder