Skip to content

Instantly share code, notes, and snippets.

View alexventuraio's full-sized avatar
🏠
Working from home

Alejandro Ventura alexventuraio

🏠
Working from home
View GitHub Profile
@alexventuraio
alexventuraio / blob_authenticatable.rb
Created May 14, 2022 15:27 — forked from dommmel/blob_authenticatable.rb
Devise authentication for Rails' ActiveStorage
# Rails controller concern to enable Devise authentication for ActiveStorage.
# Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding
# +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+.
#
# Optional configuration:
#
# Set the model that includes devise's database_authenticatable.
# Defaults to Devise.default_scope which defaults to the first
# devise role declared in your routes (usually :user)
#
@alexventuraio
alexventuraio / xterm-256color.svg
Created August 22, 2020 21:49 — forked from jasonm23/xterm-256color.svg
Xterm 256color mode color chart, organised into sections.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexventuraio
alexventuraio / install react-devtools v3
Created September 19, 2019 20:33 — forked from oztune/install react-devtools v3
How to install React Dev Tools v3 so that you can have highlight updates again
1. Somewhere on your machine clone the project.
```
> git clone https://github.com/facebook/react-devtools.git
> cd react-devtools
```
2. Switch to the v3 branch
```
> git checkout v3
```
@alexventuraio
alexventuraio / railscasts.rb
Created December 9, 2016 03:43 — forked from samqiu/railscasts.rb
Download free Railscast video
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'
@alexventuraio
alexventuraio / node-deploy-as-upstart-service.md
Created September 22, 2016 05:21 — forked from learncodeacademy/node-deploy-as-upstart-service.md
Deploy Node.js app on Ubuntu as Upstart Service - instead of using Forever

Deploying a node app with Forever is great...until your server restarts unexpectedly. Then your app stops running and you have to re-deploy.

To get around this, we're going to run our node app as an Upstart service. Upstart services are great, because, once started, the system auto-restarts them if they fail, or if the server restarts.

###Step 1: Create a service for your node app

  • ssh in as root ssh root@youripaddress
  • Create a node-app.conf file in /etc/init
    IMPORTANT: whatever filename you pick is what you will use to start|stop|restart your service i.e. service node-app start
@alexventuraio
alexventuraio / flightplan-deploy.md
Created September 22, 2016 05:17 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@alexventuraio
alexventuraio / rails-postgres-backbone-bootstrap-bootswatch
Created August 7, 2016 18:11 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@alexventuraio
alexventuraio / web-servers.md
Created May 7, 2016 21:01 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000