Skip to content

Instantly share code, notes, and snippets.

View tarex's full-sized avatar
🎯
Focusing

Tareq Jobayere tarex

🎯
Focusing
View GitHub Profile
@tarex
tarex / wp-comment-walker
Created December 21, 2016 06:32 — forked from georgiecel/wp-comment-walker
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
@tarex
tarex / recommendation-engine-services.md
Created November 28, 2016 13:20 — forked from netologist/recommendation-engine-services.md
Recommendation Engine Services

##Recommendation Engine Services

####IREUS Recommendation Engine for stores as SaaS

http://www.ireus.net/

####Plista

@tarex
tarex / Hooks.js
Created November 15, 2016 18:46 — forked from rheinardkorf/Hooks.js
Simple WordPress like hooks system for JavaScript.
/**
* @file A WordPress-like hook system for JavaScript.
*
* This file demonstrates a simple hook system for JavaScript based on the hook
* system in WordPress. The purpose of this is to make your code extensible and
* allowing other developers to hook into your code with their own callbacks.
*
* There are other ways to do this, but this will feel right at home for
* WordPress developers.
*
@tarex
tarex / fontawesome.js
Last active September 29, 2016 10:37
font awesome grabbing from dom
var all = [];
jQuery('#icons section').each(function(index, section) {
var id = jQuery(this).attr('id');
jQuery('#'+ id + ' a').each(function(index, iconrow) {
all.push({
name: jQuery(this).text().replace('Example of','').replace(/^\s+/g, ""),
className: jQuery(this).children('i').attr('class')
});
});
});
@tarex
tarex / replace-var
Created August 25, 2016 11:12
Shell script to replace variables docker-compose.yml
#!/bin/bash
set -eu
main() {
local args=("$@")
local inFile=$(pwd)/docker-compose.yml
local outFile=$(pwd)/$1
if [[ $# -lt 2 ]]; then
usage
@tarex
tarex / Dockerfile
Created August 6, 2016 19:09 — forked from thom-nic/Dockerfile
Node.js Dockerfile based on ubuntu 14.04. This is a little smaller than dockerfile/nodejs which depends on python
# Node.js app Docker file
FROM ubuntu:14.04
MAINTAINER Thom Nichols "[email protected]"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y nodejs npm
@tarex
tarex / Git push deployment in 7 easy steps.md
Created July 22, 2016 12:53 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@tarex
tarex / .bashrc
Created July 17, 2016 21:34 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@tarex
tarex / json_postgres.js
Created July 14, 2016 18:56 — forked from lucdew/json_postgres.js
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@tarex
tarex / .htaccess-mod_headers
Created June 22, 2016 09:33 — forked from hans2103/.htaccess-mod_headers
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000