Skip to content

Instantly share code, notes, and snippets.

View jalalhejazi's full-sized avatar
:octocat:
🐝 DevOps Experimentation | Continuous Learning 🐝

Jalal Hejazi jalalhejazi

:octocat:
🐝 DevOps Experimentation | Continuous Learning 🐝
  • Denmark
View GitHub Profile
@jalalhejazi
jalalhejazi / web-server.js
Created January 25, 2014 18:33
node: WebServer support HTTP-GET and HTTP-POST (index.html as default)
/*=======================================================================
= Node Simple HTTP-WebServer by Jalal Hejazi 2014 =
=======================================================================*/
var util = require('util'),
http = require('http'),
fs = require('fs'),
url = require('url'),
events = require('events');
@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