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.

@mrbar42
mrbar42 / README.md
Last active April 20, 2024 02:57
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@jonyardley
jonyardley / Dockerfile
Last active March 3, 2023 21:12
Precompile Ruby on Rails assets with Docker
ARG ASSET_HOST
RUN bundle exec rake ASSET_HOST=${ASSET_HOST} RAILS_ENV=production assets:precompile
@mtchavez
mtchavez / disk-check.json
Last active September 27, 2020 17:56
Consul Nagios Example Checks
{
"check": {
"id": "check-disk",
"name": "check-disk",
"script": "/usr/lib/nagios/plugins/check_disk -w 30% -c 5%",
"interval": "1m"
}
}
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active April 21, 2024 02:41
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@yuki24
yuki24 / .gitignore
Last active November 9, 2021 16:15
jbuilder vs ActiveModel::Serializers
log/
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@kylemcdonald
kylemcdonald / post-server.py
Created September 21, 2014 01:24
Python POST simple server
import SimpleHTTPServer
import SocketServer
PORT = 8000
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_POST(self):
content_len = int(self.headers.getheader('content-length', 0))
post_body = self.rfile.read(content_len)
@iainconnor
iainconnor / Android Studio .gitignore
Created January 24, 2014 20:20
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@kujohn
kujohn / portforwarding.md
Last active January 21, 2022 02:36
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like: