Skip to content

Instantly share code, notes, and snippets.

View ychaker's full-sized avatar

Youssef Chaker ychaker

View GitHub Profile
@ychaker
ychaker / facebook_data_feed_controller.rb
Created November 22, 2018 02:37 — forked from octave/facebook_data_feed_controller.rb
Basic Facebook CSV Product Feed Support for Solidus
class FacebookDataFeedController < ApplicationController
def export
@products = Spree::Product.available
respond_to do |format|
format.csv { send_data @products.to_fb_csv, filename: "facebook-data-feed.csv" }
end

Sessions and Conversations

HTTP is a stateless protocol. Sessions allow us to chain multiple requests together into a conversation between client and server.

Sessions should be an option of last resort. If there's no where else that the data can possibly go to achieve the desired functionality, only then should it be stored in the session. Sessions can be vulnerable to security threats from third parties, malicious users, and can cause scaling problems.

That doesn't mean we can't use sessions, but we should only use them where necessary.

Adding, Accessing, and Removing Data

[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = pavan.sss1991@gmail.com

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna