Skip to content

Instantly share code, notes, and snippets.

View jalalhejazi's full-sized avatar
💭
DevOps Automation

Jalal Hejazi jalalhejazi

💭
DevOps Automation
View GitHub Profile
@jalalhejazi
jalalhejazi / from_atom_to_page.html
Created January 17, 2014 15:03
IMAGE: From Atoms to Pages
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>from atom to Page</title>
</head>
<body>
/**
* TaskRepository class deals with task persistence
*/
function TaskRepository() {
this.tasks = [];
this.nextId = 1;
}
/**
* Find a task by id
* Param: id of the task to find
@jalalhejazi
jalalhejazi / gist:7944190
Last active December 31, 2015 05:59 — forked from liamcurry/gist:2597326
from jQuery To Vanilla

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@jalalhejazi
jalalhejazi / ServiceStack EXEC SP
Created November 24, 2013 19:39
ServiceStack EXEC Stored Procedures
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using NUnit.Framework;
using ServiceStack.Common;
using ServiceStack.Text;
namespace ServiceStack.OrmLite.Tests
{
/**
* TaskRepository class deals with task persistence
*/
function TaskRepository() {
this.tasks = [];
this.nextId = 1;
}
/**
* Find a task by id
* Param: id of the task to find
@jalalhejazi
jalalhejazi / gist:7427251
Last active December 28, 2015 02:19
Sublime Text - Useful Shortcuts (PC)

Sublime Text – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
/* Tutorial example from:
* Your First ASP.NET Web API (C#):
* http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
*/
namespace HelloWebAPI.Controllers
{
public class ProductsController : ApiController
{
Product[] products = new Product[]
{
http://www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html
@jalalhejazi
jalalhejazi / jQuery.loadScript
Created September 15, 2013 20:10 — forked from bradvin/jQuery.loadScript
jQuery.loadScript
jQuery.loadScript = function (url, arg1, arg2) {
var cache = false, callback = null;
//arg1 and arg2 can be interchangable as either the callback function or the cache bool
if ($.isFunction(arg1)){
callback = arg1;
cache = arg2 || cache;
} else {
cache = arg1 || cache;
callback = arg2 || callback;
}