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 / tooltip.js
Created October 14, 2012 03:29
jquery plugin - tooltip
// tooltip , i used in http://fbviralpictures.com/
(function(jQuery) {
jQuery.fn.k_tooltip = function(options) {
var defaults = {
use: 'title',
tooltipClass: 'tooltip'
};
var options = jQuery.extend(defaults, options),
@tarex
tarex / create.applescript
Created December 15, 2012 18:07
Create new file with Alfred
property DefaultPath : "~/Desktop"
property fileExt : ""
on alfred_script(q)
tell application "Finder"
try
set currentPath to (POSIX path of (target of front window as alias))
on error
set currentPath to DefaultPath
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@tarex
tarex / Deploy your site with git.md
Last active July 18, 2016 18:09 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@tarex
tarex / Build an Amazon EC2 LAMP Server.md
Last active July 18, 2016 18:06 — forked from aronwoost/README.md
Build an Amazon EC2 LAMP Server

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/