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 PeopleDAL | |
{ | |
public DataSet Person_GetAll() | |
{ | |
//Returns a DataSet containing all people records in the database. | |
} | |
public DataSet Person_GetByPersonID(int personID) | |
{ |
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 PeopleRepository | |
{ | |
public List<PersonDTO> Get() | |
{ | |
//return a list of person data transfer objects here | |
} | |
public void Insert(PersonDTO person) | |
{ | |
//insert a person here |
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 PeopleRepository() { | |
//when using constructor functions like this one to create objects in js, | |
//always make sure you're doing so with the new keyword | |
//or the scope will be off | |
// | |
//like so: | |
if(!(this instanceof PeopleRepository) { | |
return new PeopleRepository(); | |
//we just enforced new | |
} |
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
/** | |
* allows you to wrap or insert an html tag over a selection/range using rangy | |
* @param iframe the CKEditor iframe html element | |
* @param tagName string representation of the tag, such as 'a' for anchor | |
* @param withNodeFunc function to allow outside modification of the element before injecting/wrapping | |
*/ | |
function wrapOrInsert(iframe, tagName, withNodeFunc) { | |
var iframedoc = iframe.contentDocument || iframe.contentWindow.document, | |
tag = iframedoc.createElement(tagName), | |
selection = rangy.getIframeSelection(iframe), |
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
//grab all divs on the page | |
//and set their width to 300 | |
d3.selectAll('div') | |
.attr("width",300) | |
.attr("height",400); |
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
//select all divs | |
d3.selectAll('div') | |
//map some data to those divs, in order that they were found in the DOM | |
.data(["hello","world","hi"]) | |
//and now do something to the divs with that data | |
//perhaps, put the data in the divs | |
//so this function param "d" is actually the data for that div | |
.html(function(d) { | |
return d; | |
}); |
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
<html> | |
<head> | |
<title>d3test</title> | |
<link href="bootstrap-1.1.0.min.css" type="text/css"></link> | |
<script src="d3.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="demo"> | |
<svg id="svgdemo"></svg> | |
</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
//so there's two divs on the page for this to select | |
d3.select('body') | |
.selectAll('div') | |
.data(["hello","there","world"]) | |
//this will map "hello" and "there" to the only two divs | |
.html(function(d){return d;}) | |
//but theres 3 pieces of data...? | |
//this is why d3 has the enter() function | |
//think of it as "withTheLeftOverDataAfterMapping()" instead of "enter()" | |
.enter() |
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
#!/bin/bash | |
# html5 videos maker | |
ffmpeg -i $1 -b 1500k -vcodec libx264 -g 30 -s 640x360 $1.mp4 | |
ffmpeg -i $1 -b 1500k -vcodec libvpx -acodec libvorbis -ab 55000 -f webm -g 30 -s 640x360 $1.webm | |
ffmpeg -i $1 -b 1500k -vcodec libtheora -acodec libvorbis -ab 55000 -g 30 -s 640x360 $1.ogv |
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 HoganExpressAdapter=(function(){ | |
var init=function(hogan) { | |
var compile=function(source){ | |
return function(options) { | |
return hogan.compile(source).render(options); | |
}; | |
} | |
return {compile:compile}; | |
}; | |
return {init:init}; |
OlderNewer