Skip to content

Instantly share code, notes, and snippets.

View Qasem-h's full-sized avatar
🏠
Working from home

Qasem Hajizadeh Qasem-h

🏠
Working from home
View GitHub Profile
@Qasem-h
Qasem-h / memcache_vs_redis.md
Created October 3, 2016 23:11 — forked from psahni/memcache_vs_redis.md
Comparison of memcache and redis [ Ruby on Rails ]

##Memcache

Memcache can be used for caching data in main memory using key value pair. So it reduces database load significantly. It is actually a storage engine used by Rack::Cache which is a middleware in Rails that provides HTTP caching. For example we can store a complex query result into a key

Rails.cache.fetch(key) do
  #......Processing
end
@Qasem-h
Qasem-h / cat block
Last active August 29, 2015 14:19
Pic-block
<?php
global $count2, $block, $page_builder_id ;
$Cat_ID = $block['id'];
$rand = $offset = $order = $posts_num = '';
if( !empty($block['number']) )
$posts_num = $block['number'];
if( !empty($block['order']) )