/**
*@namesomeFunction
*@authorkfb
*
*Basicusage:
* var someFunction = new SomeFunction();
* someFunction.init();
*
* additionally you can use methods like someFunction.methodName();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public ActionResult Edit(ViewModel viewModel) | |
{ | |
if (ModelState.IsValid) | |
{ | |
repository.SaveModel(viewModel); | |
TempData["message"] = "Changes have been saved"; | |
return RedirectToAction("Index"); | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; | |
font-family: Arial, Helvetica, san-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model MyAppDomain.Entities.Role | |
@{ | |
ViewBag.Title = "Create"; | |
} | |
<h2>Create</h2> | |
@using (Html.BeginForm()) { | |
@Html.ValidationSummary(true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Album; | |
use Album\Model\AlbumTable; | |
class Module | |
{ | |
public function getAutoloaderConfig() | |
{ | |
return array ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// “self-executing anonymous function” (or self-invoked anonymous function) | |
// Reference: http://stackoverflow.com/questions/188663/jquery-javascript-design-self-executing-function-or-object-literal | |
;(function($) { | |
var myPrivateFunction = function() { | |
}; | |
var init = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app; | |
app = (function(){ | |
var myPrivateVariable = "my private content"; | |
var application = { | |
init: function(){ | |
console.log(myPrivateVariable); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = app || {}; | |
//object literal | |
app = { | |
init: function(){ | |
this.cache(); | |
this.bind(); | |
}, | |
cache: function(){ | |
this.anchor = $( 'a' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.impressivewebs.com/my-current-javascript-design-pattern/#comment-32835 | |
(function ($, App, window) { | |
'use strict'; | |
var ready = false, | |
handler = function (e) { | |
}, | |
init = function (page) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
OlderNewer