A Pen by Erik Goens on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GIT_DIR=/home/deploy/[app_name] | |
WORK_TREE=/var/www/[app_name] | |
export DATABASE_USER='' | |
export DATABASE_PASSWORD='' | |
export RAILS_ENV=staging | |
. ~/.zshrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as file yml_to_json.rb | |
require 'yaml' | |
require 'json' | |
output = File.open('new_file_name.json','w') | |
output << JSON.pretty_generate(YAML.load_file('./yaml_file.yml')) | |
output.close | |
# one liner | |
ruby -e "require 'yaml';require 'json';output = File.open('new_file_name.json','w');output << JSON.pretty_generate(YAML.load_file('./yaml_file.yml'));output.close" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shortcut for assigning a heredoc to a variable. | |
# http://stackoverflow.com/a/8088167 | |
define() { | |
# read will have exit status 1 whenever it assigns to a variable or it gets to EOF. | |
read -r -d '' "${1}" || true | |
} | |
_other_aws_common_stuff() { | |
export AWS_DEFAULT_PROFILE="${AWS_PROFILE}" | |
local SCRIPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from 'react'; | |
import { findDOMNode } from 'react-dom' | |
import getOffset from 'dom-helpers/query/offset'; | |
let ScrollSpy = React.createClass({ | |
childContextTypes: { | |
$scrollSpy: PropTypes.shape({ | |
anchor: PropTypes.func, | |
activeTarget: PropTypes.string | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a new `create-react-app` prototype in the current directory | |
# this is a very basic installation whose major purpose is creating | |
# a storybook (http://getstorybook.io) for quick component creation | |
# and iteration. These components are intended to be styled with | |
# `styled-components` (https://github.com/styled-components/styled-components) | |
# | |
# usage: | |
# ruby create_prototype.rb | |
# | |
# map as an alias in your environment file (ex: ~/.zshrc) to run from any directory |
A Pen by Erik Goens on CodePen.
Credit to answer found here http://stackoverflow.com/questions/21095054/ssh-key-still-asking-for-password-and-passphrase
This will ask you for the passphrase, enter it and it won't ask again.
ssh-add ~/.ssh/id_rsa &>/dev/null
gem 'browserify-rails'
gem 'react-rails'
Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component
(and thus, prerendering).
Note that jquery-rails
can be removed from Gemfile, the npm version of jquery
and jquery-ujs
will be used instead.