Skip to content

Instantly share code, notes, and snippets.

View zaherg's full-sized avatar
🎯
Focusing

Zaher Ghaibeh zaherg

🎯
Focusing
View GitHub Profile
@zaherg
zaherg / example.php
Created March 16, 2012 08:43
install amazon-sdk sparks
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Example extends CI_Controller{
public function __construct(){
parent::__construct();
}
public function index(){
$this->load->spark('amazon-sdk/0.1.1');
@zaherg
zaherg / example.php
Created March 16, 2012 08:44
installing amazon-sdk as library
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Example extends CI_Controller{
public function __construct(){
parent::__construct();
}
public function index(){
$this->load->library('awslib');
@zaherg
zaherg / MY_Exceptions.php
Created May 22, 2012 12:58
using this file your error pages will be localized , but the error folder must contain folders like : english , arabic ... etc
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Exceptions extends CI_Exceptions {
var $ob_level;
public function __construct()
{
parent::__construct();
}
@zaherg
zaherg / ActionBarView.js
Created July 29, 2012 01:52 — forked from Mode54/ActionBarView.js
Action Bar Module for Titanium Mobile
/*
* Android API Guide
* http://developer.android.com/guide/topics/ui/actionbar.html
* Android Design Guide
* http://developer.android.com/design/patterns/actionbar.html
* Titanium Mobile will support someday
* https://jira.appcelerator.org/browse/TIMOB-2371
*/
var osName = Ti.Platform.osname,
isAndroid = osName==='android',
@zaherg
zaherg / app.js
Created September 15, 2012 10:19 — forked from aaronksaunders/app.js
Using Swipes to open and close windows in a navigation group with titanium appcelerator
//
// Aaron K. Saunders
//
// http://www.clearlyinnovative.com
// http://blog.clearlyinnovative.com
// @aaronksaunders
//
//
(function() {
var group, tab1, tab2, win1, win2;
@zaherg
zaherg / pull-to-refresh(android).js
Created November 12, 2012 12:46 — forked from jpurcell/pull-to-refresh(android).js
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
// Copyright Stephen Feather and other contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@zaherg
zaherg / gist:5720950
Last active January 11, 2017 16:16
this is what i have used to create a wildcard dns resolver when am trying to work with #laravel and domain routings

#orginal one from http://clintberry.com/2011/wildcard-sub-domains-on-osx-web-development-on-localhost/

Bind DNS Setup (OSX 10.8+)

BIND is the little piece of software the runs the internet. BIND is a DNS server and it works in a distributed fashion. It’s really fascinating how DNS works but that’s outside the scope of this post. There are a few steps to get BIND set up to serve domains and they are crucial.

sudo -s

This will let you run a shell as root. I suggest doing this because most of the next commands you will execute need to be on privileged files and directories.

# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit