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
<h2>{{ title }}</h2> | |
<div class="jumbotron"> | |
<div ng-repeat="message in messages"> | |
{{ message.user }} - {{ message.text }} | |
</div> | |
</div> | |
<div class="row marketing"> | |
<input type="text" class="form-control" ng-model="currentUser" /> |
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 class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width"> | |
<!-- Place favicon.ico and apple-touch-icon.png in the root directory --> | |
<!-- build:css(.) styles/vendor.css --> | |
<!-- bower:css --> |
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
/* Firebase snapshot */ | |
snapshot.val() | |
- Return values from Firebase at a given point in time | |
snapshot.hasChildren(); | |
snapshot.hasChild('text'); | |
snapshot.name(); |
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
function indexOfSmallest(a) { | |
var lowest = 0; | |
for (var i = 1; i < a.length; i++) { | |
if (a[i] < a[lowest]) lowest = i; | |
} | |
return lowest; | |
} | |
var a = [1, 2, 3, 4, 4, 6, 5, 0, 9]; |
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
// Array of data | |
var dataSet = [ 8, 48, 14, 31, 23 ]; | |
// SVG container | |
svg = d3.select('body').append('svg').attr({ | |
width: 600, | |
height: 400 | |
}); | |
// SVG Elements |
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
(function ($) { | |
$(function () { | |
var $html = $('html'); | |
var requests = 0; | |
function setBusy() { | |
if (++requests == 1) { | |
$html.addClass('busy-cursor'); | |
} | |
} |
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 NonQuery() | |
{ | |
var connectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString; | |
var sqlCommandText = "UPDATE People SET Name = 'John'"; | |
using (var sqlConnection = new SqlConnection(connectionString)) | |
using (var sqlCommand = new SqlCommand(sqlCommandText, sqlConnection)) | |
{ | |
sqlCommand.Connection.Open(); | |
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
app.get(/\/users\/(\d*)\/?(edit)?/,function(req, res){ | |
// /users/10 | |
// /users/10/ | |
// /users/10/edit | |
var message = "user #" + req.params[0] + "'s profile"; | |
if(req.params[1] === 'edit'){ | |
message = "Editing " + message; | |
} else { |
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
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
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
@font-face { | |
font-family: 'GillSans Std Regular'; | |
src: url('/fonts/gillsansstd-webfont.eot'); | |
src: url('/fonts/gillsansstd-webfont.eot?#iefix') format('embedded-opentype'), | |
url('/fonts/gillsansstd-webfont.ttf') format('truetype'), | |
url('/fonts/gillsansstd-webfont.svg#GillSansStdRegular') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
@font-face { /* for non-IE */ |