Skip to content

Instantly share code, notes, and snippets.

View khovansky-al's full-sized avatar

Alexander Khovansky khovansky-al

View GitHub Profile
@khovansky-al
khovansky-al / spec_helper.rb
Created March 28, 2016 13:04 — forked from gbpereira/spec_helper.rb
Clean up carrierwave's files for rspec. Ruby 2.0, Rails 4.0.2.
Dir["#{Rails.root}/app/uploaders/*.rb"].each { |file| require file }
if defined?(CarrierWave)
CarrierWave::Uploader::Base.descendants.each do |klass|
next if klass.anonymous?
klass.class_eval do
def cache_dir
"#{Rails.root}/spec/support/uploads/cache"
end
import React from 'react';
import { render } from 'react-dom';
import { Panel, FormControl } from 'react-bootstrap'
const styles = {
fontFamily: 'sans-serif',
textAlign: 'center',
};
const buildSecureComponent = ({ interactive, Component }) => {
@khovansky-al
khovansky-al / docker-cleanup-resources.md
Created November 24, 2017 13:29 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

/*
Ported from https://github.com/zslucky/redux-fetch-middleware
and fixed (though some things are still broken) by @khovansky
*/
import { merge } from 'lodash'
import uuid from 'uuid'
import defaultConfig from './config'
// Default response type for module

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

Keybase proof

I hereby claim:

  • I am khovansky-al on github.
  • I am khovansky (https://keybase.io/khovansky) on keybase.
  • I have a public key ASDesiC6tEUIoekbgTyRt03ovuWrAb4lrV_hhdneNcWOQwo

To claim this, I am signing this object: