Skip to content

Instantly share code, notes, and snippets.

View nerdyrasa's full-sized avatar

RB nerdyrasa

  • Pleasant Prairie, WI
View GitHub Profile
@nerdyrasa
nerdyrasa / index.html
Created September 10, 2018 20:54
JQM latest - issue template // source http://jsbin.com/tosomuhalu
<!DOCTYPE html>
<html>
<head>
<title>JQM latest - issue template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.css">
<script src="http://code.jquery.com/jquery-1.10.1.js"></script>
<script src="http://code.jquery.com/mobile/git/jquery.mobile-git.js"></script>
<script>
@nerdyrasa
nerdyrasa / main.spec.js
Created May 20, 2018 00:48 — forked from auser/main.spec.js
Gist that sits alongside the protractor post at http://www.ng-newsletter.com/posts/practical-protractor.html
describe('e2e: main', function() {
var ptor;
beforeEach(function() {
browser.get('/');
ptor = protractor.getInstance();
});
it('should load the home page', function() {
@nerdyrasa
nerdyrasa / README.md
Created February 24, 2017 13:42 — forked from ngryman/README.md
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
<!--
Responsive Web Design Basics
https://developers.google.com/web/fundamentals/design-and-ui/responsive/
Use the meta viewport tag to control the width and scaling of the browser's viewport.
Include width=device-width to match the screen's width in device-independent pixels.
Include initial-scale=1 to establish a 1:1 relationship between CSS pixels and device-independent pixels.
Ensure your page is accessible by not disabling user scaling.
// https://css-tricks.com/forums/topic/setting-a-div-height-to-the-window-viewport-size/
$(document).ready(function(){
resizeDiv();
});
window.onresize = function(event) {
resizeDiv();
}
@nerdyrasa
nerdyrasa / app_start-webapiconfig.cs
Created September 17, 2016 23:14
Web Api CSRF Protection
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Web.Http;
using Vidly.Handlers;
namespace Vidly
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
@nerdyrasa
nerdyrasa / Web.config
Created September 11, 2016 20:35
When you create a new project that makes use of Entity Framework 5 (and 6), it uses LocalDb by default now. But let’s assume you have a fully working instance of Sql Server that you wish to work against instead of LocalDb. How do you tell EF to use it? Simple, modify your application’s config file. If you are running a web service or a website, …
<connectionStrings>
<add name="AW" connectionString="Data Source=.\sql2014;Initial Catalog=AdventureWorks2014;Integrated Security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="AW" />
</parameters>
<div id="remote">
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture">
</div>
// 1. Select a theme from bootswatch.
// 2. Download the css to the Content folder and name it with the theme name. For example, bootstrap-readable.css.
// 3. In solution explorer, show all files. Add the new file to the project so it's tracked in source control.
// 4. Update BundleConfig.cs to use the new file.
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap-readable.css",
"~/Content/site.css"));
@nerdyrasa
nerdyrasa / WebApiConfig.cs
Created August 26, 2016 17:31
Configure json formatting in WebApiConfig.cs file in the Register method.
public static void Register(HttpConfiguration config)
{
// Configure json formatting so pascal casing in c# code will be
// camel case for javascript.
// Set formatting to Formatting.Indented
var settings = config.Formatters.JsonFormatter.SerializerSettings;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
settings.Formatting = Formatting.Indented;