Skip to content

Instantly share code, notes, and snippets.

View ahmadnaser's full-sized avatar

Ahmad Naser ahmadnaser

View GitHub Profile
@ahmadnaser
ahmadnaser / PointsHandler.cs Raycast Mouse
Created December 3, 2015 17:49
PointsHandler.cs Raycast Mouse with Click Event for points game object
using UnityEngine;
using System.Collections;
public class PointsHandler : MonoBehaviour {
GameObject CurrentPoint;
// Use this for initialization
void Start () {
}
@ahmadnaser
ahmadnaser / DragDropMatchingItem.cs for stickers 2d
Created November 23, 2015 05:53
DragDropMatchingItem.cs for stickers 2d (on click stickers) Simplified version
using UnityEngine;
using System.Collections;
public class DragDropMatchingItem : MonoBehaviour
{
private bool startDraging;//start draging flag
private bool clickedOnDest;//clicked on a destination flag
private GameObject currentMatchingItemSource;//current matching item
private GameObject currentMatchingItemDest;//current matching item
@ahmadnaser
ahmadnaser / flatybox controller unity 3d professional 2d games
Created August 14, 2015 03:09
flatybox controller unity professional 2d games course on udemy
using UnityEngine;
using System.Collections;
using UnityEngine;
using System.Collections;
public class Controller : MonoBehaviour {
private bool isGrounded;
private float radius = 0.7f;
private float force = 300;
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
add_action('wp_head', 'change_fp_ids');
function change_fp_ids(){
add_filter('fpc_featured_pages_ids', 'my_fp_ids', 20);
function my_fp_ids( $fp_ids ){
$role_page = array(
// Role => Page/Post name
'administrator' => 'Blog',
'editor' => 'A',
);
// do nothing if in admin backend or in the customize
@ahmadnaser
ahmadnaser / work with JCalendar in java
Created February 5, 2015 12:10
work with JCalendar in java
import java.util.Calendar;
public void Date() {
Calendar cal = new GregorianCalendar();
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_MONTH);
jLabel4.setText(year + "/" + (month + 1) + "/" + day);
int se = cal.get(Calendar.SECOND);
@ahmadnaser
ahmadnaser / java script ie detector
Created February 4, 2015 15:06
java script ie detector
($.browser.msie && $.browser.version == 6)
(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
@ahmadnaser
ahmadnaser / Create an model object in javascript
Created January 15, 2015 13:28
Create an model object in javascript
var WP_REST_OB;
// Create an model object.
var WP_REST = function() {
var self = this;
self.firstName = "Ahmad";
self.lastName = "Naser";
// Create a dependent method (calculated field).
@ahmadnaser
ahmadnaser / gist:660c5626ddf77f1ecaad
Created December 29, 2014 07:57
apache rewrite samples
Example1
rewrite specific page by id
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^coupons/(.*)$ /index.php?page_id=87 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
@ahmadnaser
ahmadnaser / wordpress get all the categories from the database
Created December 24, 2014 00:01
wordpress get all the categories from the database
<?php
// get all the categories from the database
/* Loop through each category "team" and output the posts */