Skip to content

Instantly share code, notes, and snippets.

View eaconde's full-sized avatar

Eric Conde eaconde

View GitHub Profile
@eaconde
eaconde / rspec_model_testing_template.rb
Last active August 29, 2015 14:26 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@eaconde
eaconde / partial_helper.js.coffee
Created October 4, 2015 12:48 — forked from twetzel/partial_helper.js.coffee
.eco - Partials .. Render Partials in .jst.eco templates (for Rails + Spine / maybe Backbone)
# Render Partials in ECO-Templates like in Rails-ERB
#
# usefull to clean up structure in spine.js and other js-mvc´s like backbone
#
# usage:
# <%- render_partial 'path/to/partial' %> .. will render ../spine-app/views/path/to/_partial.jst.eco
# <%- render_partial 'path/to/partial', foo: 'bar' %> .. will render ../spine-app/views/path/to/_partial.jst.eco .. locals = @foo
#
window.render_partial = ( path, options = {} ) ->
# add the leading underscore (like rails-partials)
@eaconde
eaconde / capybara.md
Created October 9, 2015 18:04 — forked from steveclarke/capybara.md
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@eaconde
eaconde / README.md
Created October 25, 2016 08:25 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan

OUTDATED, see comments below

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@eaconde
eaconde / random_generator.rb
Created March 3, 2017 06:50
Random Stuff Generator
# MAC Address
(1..6).collect { "%02x" % [rand(255)] }.join(":").upcase
# IP Adress
4.times.collect { rand(128) }.join(".")
# Port
1024 + rand(64512)
@eaconde
eaconde / App.js
Created July 17, 2017 16:29 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
function flatten(object, separator = '.') {
const isValidObject = value => {
if (!value) {
return false
}
const isArray = Array.isArray(value)
const isObject = Object.prototype.toString.call(value) === '[object Object]'
const hasKeys = !!Object.keys(value).length

Project Configuration

Create the rails project

$ rails new capistrano-rails
$ cd capistrano-rails

Initialize Git

Keybase proof

I hereby claim:

  • I am eaconde on github.
  • I am econde (https://keybase.io/econde) on keybase.
  • I have a public key whose fingerprint is 9ED4 0235 3695 EAFF 12FC 4817 76A8 034C EF39 C8BC

To claim this, I am signing this object:

@eaconde
eaconde / chmod & chown.txt
Last active May 27, 2018 05:01
chmod & chown
// BASICS
// ~~~~~~~~~~~~~~~~
// get directory info
ls -al (| grep ? )
// markers (first letter)
d = directory
l = symlinked
- = file