Skip to content

Instantly share code, notes, and snippets.

View kunle's full-sized avatar

Kunle kunle

  • Canada
  • 06:36 (UTC -04:00)
View GitHub Profile
@TRex22
TRex22 / useful_ruby_rails_console_tricks.md
Last active March 18, 2024 14:08
Useful Ruby/Rails console tricks

Get all records in state

Rails.application.eager_load!
ActiveRecord::Base.subclasses(&:name)

Get last console output

variable = _

Run a rails console in Sandbox mode

@chand
chand / rails-drop-tablemigration-model-controller.md
Last active November 5, 2023 22:33
Drop Table, Model, Migration in Rails

Dropping Migration Table, Models, Controller

Command Line

1. Drop Table/Migration

rails generate migration DropTablename

A file will be created, in the db > migrate folder, make sure it looks like:

@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');