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
# Auto Health Check with Powershell | |
# By Winson | |
# https://www.Coderblog.in | |
# The root folder | |
$RootFloder = "$pwd\" | |
# Add the working directory to the environment path. |
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
public class AclAttribute : AuthorizeAttribute | |
{ | |
string _notAllowRoles; | |
string _allowActions; | |
/// <summary> | |
/// Set the ACL attribute for access right | |
/// </summary> | |
/// <param name="NotAllowRoles">Not allow roles, split with comma</param> | |
/// <param name="AllowActions">Set the actions allow for the restrict roles</param> |
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
[Acl("Account", AllowActions: "Index,View")] | |
public class CirculationController : BaseController | |
{ | |
public CirculationController() | |
{ | |
} | |
public ActionResult Index() | |
{ | |
//do something... |
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
public override void OnAuthorization(AuthorizationContext filterContext) | |
{ | |
if (filterContext == null) | |
{ | |
throw new ArgumentNullException("filterContext"); | |
} | |
//get the current action for check the accessright | |
var currentAction = filterContext.RouteData.Values["Action"]; | |
bool ignore = false; |
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
Titanium.Facebook.appid = "YOUR APP ID"; | |
Titanium.Facebook.permissions = ['publish_stream', 'read_stream', "user_checkins", "publish_checkins"]; | |
function doFacebookCheckin(_callback) { | |
var getInfo = function(localCallback) { | |
// GOTCHA - You need to stringify the coordinates or the | |
// the API call will fail, this was a PITA to find | |
var data = { |
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
function doClickMenu(evt){ | |
alert(evt.source.title); | |
} | |
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event | |
$.win.addEventListener('open',function(){ | |
var actionBar = $.win.activity.actionBar; // get a handle to the action bar | |
actionBar.title='My App'; // change the App Title | |
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back | |
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed |