This file contains hidden or 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
| # Traversing arrays and objects in CoffeeScript | |
| # The array and object we use for testing | |
| arr = [1, 2, 3, 4, 5] | |
| obj = {a: 1, b: 2, c: 3, d: 4, e: 5} | |
| # 'in' has a different meaning in CoffeeScript than in JavaScript | |
| # CS: element in array -> JS: array.indexOf(element) >= 0 | |
| console.log '5 in arr: ' + (5 in arr) |
This file contains hidden or 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
| #Varaible Declaration | |
| MyWorld = | |
| script: 'Coffescript' | |
| #function | |
| text:(_arg) -> | |
| console.log "Hi "+ @script+" "+_arg | |
| #Function with parameter | |
| MyWorld.text('Your Awesome!') |
This file contains hidden or 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> | |
| <html ng-app=""> | |
| <head> | |
| <!--Library Starts Here --> | |
| <script src="http://code.jquery.com/jquery.min.js"></script> | |
| <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
| <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
| <!--Library Ends Here --> | |
| <title>Angular JS Workspace</title> |
This file contains hidden or 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> | |
| <html> | |
| <head><!-- CDN hosted by Cachefly --> | |
| <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script> | |
| <script> | |
| tinymce.init({selector:'textarea', | |
| menubar : false, | |
| toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" | |
| }); | |
| </script> |
This file contains hidden or 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
| using (ClientContext clientContext = new ClientContext("https://yoursite.sharepoint.com/")) | |
| { | |
| SecureString passWord = new SecureString(); | |
| foreach (char c in "yourpassword".ToCharArray()) passWord.AppendChar(c); | |
| clientContext.Credentials = new SharePointOnlineCredentials("loginname@yoursite.onmicrosoft.com", passWord); | |
| Web web = clientContext.Web; |
This file contains hidden or 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
| <!--SPM:<SharePoint:ImageLink runat="server"/>--> | |
| <!--SPM:<SharePoint:SPNoScript runat="server"/>--> | |
| <!--SPM:<SharePoint:SPClientIDGenerator runat="server" ServerControlID="DeltaPlaceHolderMain;DeltaPlaceHolderPageTitleInTitleArea;DeltaPlaceHolderUtilityContent"/>--> | |
| <!--SPM:<WebPartPages:SPWebPartManager runat="Server"/>--> | |
| <!--SPM:<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>--> | |
| <!--SPM:<SharePoint:AjaxDelta id="DeltaDelegateControls" runat="server">--> | |
| <!--SPM:<SharePoint:DelegateControl runat="server" ControlId="GlobalNavigation"/>--> | |
| <!--SPM:<SharePoint:DelegateControl ControlId="GlobalSiteLink3" Scope="Farm" runat="server" Visible="false"/>--> | |
| <!--SPM:</SharePoint:AjaxDelta>--> | |
| <div id="ms-designer-ribbon"> |
This file contains hidden or 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
| /*bootstrap 3 resets for SharePoint*/ | |
| /*border-box causes many issues with SP*/ | |
| *, *:before, *:after { | |
| -webkit-box-sizing: content-box; | |
| -moz-box-sizing: content-box; | |
| box-sizing: content-box; | |
| } | |
| /*reset elements that B3 is expecting to be border-box*/ | |
| * [class^="col-"], * [class^="col-"]:before, * [class^="col-"]:after, | |
| .container, .container:before, .container:after, |
This file contains hidden or 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(document).ready(function($) { | |
| BindBrowserStyles($); | |
| BindTopNav($); | |
| BindBodySpans($); | |
| }); | |
| /* | |
| specific browsers may require specific fixes | |
| */ | |
| function BindBrowserStyles($) { |
This file contains hidden or 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 void DBConnector(String svr, String uname, String pwd, String db) | |
| { | |
| try | |
| { | |
| SqlConnection conn = new SqlConnection("Server=" + svr + ";Database=" + db + ";User Id=" + uname + ";Password=" + pwd + ";"); | |
| conn.Open(); | |
| SqlCommand cmd = new SqlCommand("insertData", conn); | |
| Console.WriteLine("DB Auth Success!"); | |
| cmd.Parameters.Add(new SqlParameter("@Name", "Tony Stark")); | |
| cmd.Parameters.Add(new SqlParameter("@Email", "tony@stark.com")); |