Skip to content

Instantly share code, notes, and snippets.

View rafaltrojanowski's full-sized avatar
🛰️

Rafał Trojanowski rafaltrojanowski

🛰️
View GitHub Profile
@rishiip
rishiip / .irbrc
Created June 7, 2020 15:57
This is my current irbrc file which contains lots of helpful things - Medium
require 'irb/completion'
require 'rubygems'
ActiveRecord::Base.logger.level = 1 if defined?(ActiveRecord)
IRB.conf[:SAVE_HISTORY] = 1000
# Overriding Object class
class Object
# Easily print methods local to an object's class
def lm
@aloucas
aloucas / rails_binding_pry_on_docker.md
Created September 28, 2017 08:45
Rails binding.pry usage with docker
  1. Initially install your pry-rails to group development on your apps Gemfile
group :development do
  # ..
  gem 'pry-rails'
  # ..
end
var npm = require("npm");
var fs = require("fs-extra");
var chokidar = require("chokidar");
var packagePaths = [
"../mobile-app/node_modules/shared-package/lib",
"../web-app/node_modules/shared-package/lib",
];
var noop = () => {};
@danjellesma
danjellesma / spinner.md
Last active May 13, 2019 03:44
Rails 4: Adding a spinner on link clicks

In Rails 4 it is useful to have a 'page loading' indicator when a user clicks a link. This is a simple way to accomplish that without external libraries. Tested on Rails 4 using TurboLinks.

Great Link for Spinning Loader gifs: http://loading.io/


On CSS Page:
.modal {
    display:    none;
 position: fixed;
@KamilLelonek
KamilLelonek / rails_routes_reloader.rb
Created February 28, 2015 12:33
Middleware for reloading routes
# lib/rails_routes_reloader.rb
class RailsRoutesReloader
def initialize(app)
@app = app
end
def call(env)
reload_routes_if_changed
return *@app.call(env)
@ultimatemonty
ultimatemonty / environment.js
Last active January 19, 2017 09:19
PubNub with Ember CLI
// config/environment.js
module.exports = function(environment) {
var ENV = {
modulePrefix: 'ember-cli-pubnub',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
@treble37
treble37 / step1-testing-elasticsearch.rb
Created February 3, 2015 05:46
Step 1 - Testing ElasticSearch - spec_helper.rb
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause this
# file to always be loaded, without a need to explicitly require it in any files.
#
# Given that it is always loaded, you are encouraged to keep this file as
# light-weight as possible. Requiring heavyweight dependencies from this file
# will add to the boot time of your test suite on EVERY test run, even for an
# individual file that may not need all of that loaded. Instead, make a
# separate helper file that requires this one and then use it only in the specs
@makmanalp
makmanalp / comparison.md
Last active June 10, 2024 14:24
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

@avaz
avaz / index.js
Created October 30, 2014 18:26
An approach to Bootstrap Modals in EmberJS using Mixins
import Ember from 'ember';
import ModalSupport from '../mixins/modal-support';
export default Ember.Controller.extend(ModalSupport, {
actions: {
tryModal: function() {
var _this = this;
_this.modalFor({template: 'some-template',
title: 'Some Title'})
@arenoir
arenoir / group-by.js
Last active March 26, 2016 21:39
Ember group by computed macro
import Ember from 'ember';
var get = Ember.get,
arrayComputed = Ember.arrayComputed;
export default function (dependentKey, property) {
var options = {