Skip to content

Instantly share code, notes, and snippets.

View MBehtemam's full-sized avatar
🦄
Full Of Energey

Mohammad Bagher Ehtemam MBehtemam

🦄
Full Of Energey
View GitHub Profile
@MBehtemam
MBehtemam / index.js
Last active August 29, 2015 13:56
Koa Application 1
var koa = require('koa'),
route = require('koa-route'),
app = koa();
app.use(route.get('/',function *(){
this.body = "HELLO WORLD";
}));
@MBehtemam
MBehtemam / app.js
Created February 25, 2014 06:15
koa app
/**
* This is Base Application and other application mount on this App.
* Also this is Start-up App.
*/
var koa = require('koa'),
fs = require('fs'),
views = require('koa-render'),
router = require('koa-route'),
hbs = require('koa-hbs'),
mount= require('koa-mount'),
<!DOCTYPE html>
<html ng-app="App">
<head>
<meta name="description" content="AngularJS + jQuery UI Drag-n-Drop" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<meta charset=utf-8 />
@MBehtemam
MBehtemam / NCalendar-event-json
Created August 2, 2014 10:51
NCalendar Event JSON
[
{title:'One Day Event',start:'1393/4/10',link:'http://www.facebook.com',color:'#663399'},
{title:'One Day Event',start:'1393/5/25',link:'http://www.facebook.com',color:'#663399',description:'One Day event Happen'},
{title:'One Day Event asdf',start:'1393/5/25',link:'http://www.facebook.com',color:'#6C7A89'},
{title:'One Day Event 2',start:'1393/5/27',link:'http://www.google.com',color:'black'},
{title:'One Day Event 3',start:'1393/5/30',color:'#dd55ee'},
{title:'Event 1',start:'1393/5/1',end:'1393/5/5',color:'#F62459',description:'<h5>This <b>Event</b> 1 <u>Description</u></h5><hr/>'},
{title:'Event 5',start:'1393/5/14',end:'1393/5/18',color:'#E87E04'},
{title:'Event 6',start:'1393/5/14',end:'1393/5/16',color:'#6C7A89'},
{title:'Event 7',start:'1393/5/14',end:'1393/5/17',color:'#03A678'},
@MBehtemam
MBehtemam / ncalendar holiday
Created August 2, 2014 10:53
NCalendar Holiday Model
{title:"روز ترویج آموزش های فنی و حرفه ای",date:"1393/5/6",vacation:false},
{title:"مرداد روز، جنش مردادگان",date:"1393/5/7",vacation:false},
{title:"عید سعید فطر",date:"1393/5/7",vacation:true},
{title:"روز اهدای خون",date:"1393/9/6",vacation:false},
{title:"روز بزرگداشت ابوعلی سینا و روز پزشک",date:'1393/6/1',vacation:false},
{title:"آغاز هفته دولت",date:'1393/6/2',vacation:false},
{title:"روز مبارزه با تروریسم",date:'1393/6/8',vacation:false},
{title:"جشن آب پاشونک",date:'1393/5/1',vacation:false},
{title:"روز جهانی مبارزه",date:'1393/5/5',vacation:false},
{title:"This is Test",date:'1393/5/14',vacation:false}
@MBehtemam
MBehtemam / ncalendar holiday
Created August 2, 2014 10:54
NCalendar Holiday Model
[{title:"روز ترویج آموزش های فنی و حرفه ای",date:"1393/5/6",vacation:false},
{title:"مرداد روز، جنش مردادگان",date:"1393/5/7",vacation:false},
{title:"عید سعید فطر",date:"1393/5/7",vacation:true},
{title:"روز اهدای خون",date:"1393/9/6",vacation:false},
{title:"روز بزرگداشت ابوعلی سینا و روز پزشک",date:'1393/6/1',vacation:false},
{title:"آغاز هفته دولت",date:'1393/6/2',vacation:false},
{title:"روز مبارزه با تروریسم",date:'1393/6/8',vacation:false},
{title:"جشن آب پاشونک",date:'1393/5/1',vacation:false},
{title:"روز جهانی مبارزه",date:'1393/5/5',vacation:false},
{title:"This is Test",date:'1393/5/14',vacation:false}
(function() {
"use strict";
angular.module('gen.genericDirectives', [])
.directive('genDynamicDirective', ['$compile',
function($compile) {
return {
restrict: "E",
require: '^ngModel',
scope: true,

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

@MBehtemam
MBehtemam / D.cs
Last active August 29, 2015 14:17 — forked from onevcat/D.cs
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
using UnityEngine;
using System.Collections;
// setting the conditional to the platform of choice will only compile the method for that platform
@MBehtemam
MBehtemam / C#
Last active May 29, 2016 09:37
Is Player Grounded in Unity with CircleCast
public LayerMask layerGround; //Layer mask
private bool IsGrounded()
{
bool isGrounded = false;
if (Physics2D.CircleCast (transform.position, 0.1f, Vector2.down, 0.5f, layerGround)){
isGrounded = true;
}
else{
isGrounded = false;
}