Skip to content

Instantly share code, notes, and snippets.

View s-taylor's full-sized avatar

Simon Taylor s-taylor

View GitHub Profile

PAPER - work out what form all of your data will take- tables and field names

TERMINAL - rails new NAME -d postgresql

TERMINAL - cd into that NAME folder and subl .

SUBL - open your gemfile and add all the extra gems you want

TERMINAL - bundle

#Make sure the postgres App is running on computer
#Carrierwave works with ORM such as Active Record and Datamapper;
rails new carrier_wave_app -d postgresql
add production and development database to database.yml #make sure you do not add one of the fields to production
rails g scaffold art_galleries name:string location:string avatar:text #Also create the table in migrations folder;
#Is it added to the protected attributes method in the controller;
#Add root_to in the config.routes;
gem 'carrierwave'
rails generate uploader Avatar #Give you a class in app/uploaders/avatar_uploader.rb
rails g migration add_avatar_to_art_galleries avatar:string
import time
import requests
import json
class DownloadStationAPI():
def __init__(self, host=None, username=None, password=None):
self.name = 'DownloadStation'
@s-taylor
s-taylor / README.md
Created May 6, 2020 06:08 — forked from borekb/README.md
How to link to headings in GitHub issues and pull requests

How to link to headings in GitHub issues and pull requests

If you have an issue comment / PR description on GitHub, it doesn't automatically get anchors / IDs that you could link to:

Screenshot 2019-07-11 at 13

What I like to do is to add a visible # character like this:

Screenshot 2019-07-11 at 13 42 21

@s-taylor
s-taylor / au.lua
Created June 23, 2022 05:27 — forked from numToStr/au.lua
Neovim autocmd in lua
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then