Skip to content

Instantly share code, notes, and snippets.

@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active March 30, 2024 09:07
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@preetpalS
preetpalS / dotenv-mode.el
Last active October 30, 2019 22:11
An Emacs major mode for .env files
;;; dotenv-mode.el --- Major mode for .env files -*- lexical-binding: t; -*-
;; Author: Preetpal S. Sohal
;; URL: https://github.com/preetpalS/emacs-dotenv-mode
;; Version: 0.2.5
;; Package-Requires: ((emacs "24.3"))
;; License: GNU General Public License Version 3
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@eliasby
eliasby / override_git_tag.sh
Last active March 20, 2020 10:57
override git tag
# Delete the tag on any remote before you push
git push origin :refs/tags/<tagname>
# Replace the tag to reference the most recent commit
git tag -fa <tagname>
# Push the tag to the remote origin
git push origin master --tags
# source: http://stackoverflow.com/questions/8044583/how-can-i-move-a-tag-on-a-git-branch-to-a-different-commit

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@goncalvesjoao
goncalvesjoao / Gemfile
Last active November 13, 2020 01:52
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@littlemove
littlemove / my-ruby.el
Created March 18, 2016 11:40
Spacemacs: Code folding for ruby-mode
;; Code folding
(add-hook 'ruby-mode-hook
(lambda () (hs-minor-mode)))
(eval-after-load "hideshow"
'(add-to-list 'hs-special-modes-alist
`(ruby-mode
,(rx (or "def" "class" "module" "do" "{" "[")) ; Block start
,(rx (or "}" "]" "end")) ; Block end
,(rx (or "#" "=begin")) ; Comment start
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-configuration-layer-path '("~/.spacemacs.d/")
dotspacemacs-delete-orphan-packages t
dotspacemacs-distribution 'spacemacs
dotspacemacs-configuration-layers
`((auto-completion
:variables

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@Lewuathe
Lewuathe / .spacemacs
Created October 13, 2015 13:14
spacemacs
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()