Skip to content

Instantly share code, notes, and snippets.

@os6sense
os6sense / gist:35b9e37eb8f23bdb4a81cde1cc23aa03
Created May 12, 2017 13:26
Using memory_profiler with rails
add to gemfile :
gem 'memory_profiler', require: true, github: 'SamSaffron/memory_profiler'
Add a config/initializer/memory_profiler.rb as follows:
MemoryProfiler.start
at_exit do
report = MemoryProfiler.stop
report.pretty_print
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@amicming
amicming / rails-5-new-options
Last active January 4, 2018 15:23
Command line options for rails _5.0.0.1_ new --help. Easy to handy when you create rails application
$ rails _5.0.0.1_ new --help
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/apandya/.rvm/rubies/ruby-2.3.3/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
@maxivak
maxivak / __readme.md
Last active October 7, 2017 11:15
Deploying Rails app using Docker and Capistrano

Deploying Rails app using Docker and Capistrano

Concept

Remote server:

  • Docker container with Passenger

  • Data volume (directory on the remote host) to store files for the app

  • Directory structure in data volume (directory /data/apps/app1):

@karloku
karloku / README.md
Last active March 30, 2018 07:28
Rails Template using GraphQL

This template is supposed to be applied to rails 5.

run with:

rails new <application_name> --template=https://gist.githubusercontent.com/karloku/edd6a158e275fdefa334/raw/b56175bee5b45d32310aeb620e23be44e3c2a56d/graphql_template.rb -T

using gems:

  • graphql
  • graphql-mutable_type
@vasanthk
vasanthk / System Design.md
Last active April 28, 2024 03:48
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@brianpetro
brianpetro / rails-4-new-options
Created April 28, 2015 18:11
Command line options for ` rails new --help ` (Rails 4.2). Useful for planning new Ruby on Rails app. 'Where can I find options for “rails new” command?'
Because I couldn't find these with a quick Google search on 28 April 2015:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
@replaid
replaid / ddd-rails-tree.txt
Last active March 23, 2023 02:19
A Rails directory tree that expresses DDD layers and bounded contexts.
components/
my_bounded_context/
app/
presentation/ # This is called the "UI" layer in DDD literature, but it is also
# where things like JSON interfaces live -- any kind of presentation
# or handshake to anything outside. So "presentation" rather than "ui".
assets/
helpers/
mailers/
views/
@phlegx
phlegx / Rails 4 - how to give alias names to includes() and joins() in active record quering
Last active February 12, 2024 19:12
Rails 4 - how to give alias names to includes() and joins() in active record quering
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que
- Model Student and model Teacher are both STI models with super class model User
- Model Story is a STI model with super class model Task
- includes() and joins(), both fails
Rails alias naming convention (includes() and joins())
- One model as parameter
- is base model (includes(:users))