Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
AndrewRayCode / gist:6573291
Last active December 23, 2015 03:28
This is an open source response to http://www.hsph.harvard.edu/nutritionsource/fats-full-story which I decided to write for no apparent reason
In your article "Fats and Cholesterol: Out with the Bad, In with the Good"
http://www.hsph.harvard.edu/nutritionsource/fats-full-story/#references there
is a citation to nine studies in this sentence:
"What really matters is the type of fat and the total calories in the diet.
(7-15) Bad fats, meaning trans and saturated fats, increase the risk for
certain diseases."
Your article focuses on reduction of "bad fats" including saturated fatty
acids.
var good = 0,
bad = 0,
reqtime;
function post() {
reqtime = new Date().getTime();
$.when( $.post( 'https://graph.facebook.com/YOUR_APP_ID/accounts/test-users', {
locale: 'en_US',
access_token: 'YOUR_ACCESS_TOKEN',
installed: true,
permissions: 'read_stream,email,user_likes,user_interests',
# Colors for prompt
COLOR_RED=$(tput sgr0 && tput setaf 1)
COLOR_GREEN=$(tput sgr0 && tput setaf 2)
COLOR_YELLOW=$(tput sgr0 && tput setaf 3)
COLOR_DARK_BLUE=$(tput sgr0 && tput setaf 4)
COLOR_BLUE=$(tput sgr0 && tput setaf 6)
COLOR_PURPLE=$(tput sgr0 && tput setaf 5)
COLOR_PINK=$(tput sgr0 && tput bold && tput setaf 5)
COLOR_LIGHT_GREEN=$(tput sgr0 && tput bold && tput setaf 2)
Controller:
class ModlessController < ApplicationController
def model_params
params.require(:model).permit(:tag_list)
end
end
Model:
def update
@model.update(model_params)
respond_with(@model)
end
def model_params
params.require(:model).permit( :name, :tag_list, :tags )
end
end
class ModelsController < ApplicationController
before_action :set_model, only: [:show, :edit, :update, :destroy]
respond_to :html, :json
def update
Rails.logger.info "=============="
Rails.logger.info params[:model][:tags]
Rails.logger.info params[:model][:tag_list]
Rails.logger.info "=============="
@model.update(model_params)
params.require(:modle).permit(
:name, :user_id,:image,
:tag_list, :tags, :description
)
COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
COLOR_LIGHT_CYAN=$(tput sgr0 && tput bold && tput setaf 6)
COLOR_RESET=$(tput sgr0)
say -v ? | while read line; do
voice=`echo $line | awk '{ print $1 }'`
phrase=`echo $line | sed -E 's/^.+# //'`
echo "${COLOR_LIGHT_RED}say -v ${COLOR_LIGHT_CYAN}${voice}${COLOR_RESET} $phrase"
say -v $voice $phrase
done
<ReactCSSTransitionGroup transitionName="fadeIn">
{this.state.loading && <Loading key={0} />}
{this.state.error &&
<div className="alert alert-block alert-danger" key={1}>
Error: { messages[ this.state.error ] }
</div>}
{this.state.success &&
<div className="alert alert-block alert-success" key={2}>
Success!
</div>}
// Top level component
<component>
<UserModal isOpen={this.state.whatever} />
</component>
// UserModal
{
render:function() {
return <BaseModal {...this.props}>