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 static class DataUtils | |
{ | |
public static List<SelectListItem> ConvertEnumToSelect<T>(params T[] enumObj) | |
{ | |
List<SelectListItem> enumList = new List<SelectListItem>(); | |
foreach (T data in Enum.GetValues(typeof(T))) | |
{ | |
enumList.Add(new SelectListItem | |
{ |
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 BACKSPACE = 8; | |
$(document).unbind('keydown').bind('keydown', function (event) { | |
var doPrevent = false; | |
if (event.keyCode === BACKSPACE) { | |
var d = event.srcElement || event.target; | |
if ((d.tagName.toUpperCase() === 'INPUT' && | |
(d.type.toUpperCase() === 'TEXT' || | |
d.type.toUpperCase() === 'PASSWORD' || | |
d.type.toUpperCase() === 'FILE')) |
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 | |
// get the length of your full name (first and last) | |
// multiply that by M_PI and round it to the third decimal place | |
// print out the result | |
// then print out the ceiling value of the result | |
// Next use your knowledge of strlen(), substr(), and rand() to print a random character from your name | |
echo 5 * M_PI; | |
echo '<br>'; |
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 accounts = angular.module('accounts', []), | |
controllers = {}, | |
factories = {}; | |
controllers.SearchController = function($scope, searchFactory) { | |
var searchViewModel = { | |
query: "", | |
accounts: [] | |
}; | |
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
{ | |
'100': 'Continue', | |
'101': 'Switching Protocols', | |
'102': 'Processing', | |
'200': 'OK', | |
'201': 'Created', | |
'202': 'Accepted', | |
'203': 'Non-Authoritative Information', | |
'204': 'No Content', | |
'205': 'Reset Content', |
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 | |
// shorter array initialization syntax [] instead of array() as of PHP >= 5.4 | |
$input = [ | |
'A man, a plan, a canal: Panama', | |
'Cigar? Toss it in a can. It is so tragic', | |
'Hey you guys!!!!!!' | |
]; | |
// define a constant variable | |
define('UTF8', 'UTF-8'); |
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 Palindromes; | |
interface iStringComparer | |
{ | |
function compareArrayStringsInsensitive(); // by default no visibility keyword is set to public, don't do this! | |
public function parseCodepoints(array $codepoints); | |
} |
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
FROM ubuntu:12.04 | |
MAINTAINER Andre Dublin "81dublin@gmail.com" | |
ENV REFRESHED_AT 2014-05-01 | |
RUN apt-get -y update | |
RUN apt-get -y upgrade | |
RUN apt-get -y install build-essential | |
#RUN apt-get -y install linux-headers-$(uname -r) | |
RUN apt-get -y install linux-source |
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
<!-- note that levels is coming from $scope.levels = [0,1,2,3]; --> | |
<!-- note that foobar is coming from $scope.foobar = {}; --> | |
<!-- note that foobar is coming from $scope.foobar.buzzArray = [0,0,0]; --> | |
<div ng-repeat="(index, value) in foobar.buzzArray"> | |
<label for="buzzArray[]">Buzz level {{ index + 1 }}</label> | |
<select ng-model="foobar.buzzArray" name="buzzArray[]" ng-options="level for level in levels"> | |
<option value="">-- Select Level --</option> | |
</select> | |
</div> |
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
<!doctype html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" ng-app="myapp"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" ng-app="myapp"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" ng-app="myapp"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" ng-app="myapp"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
OlderNewer