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
@states = { | |
AL: "Alabama", | |
AK: "Alaska", | |
AZ: "Arizona", | |
AR: "Arkansas", | |
CA: "California", | |
CO: "Colorado", | |
CT: "Connecticut", | |
DE: "Delaware", | |
FL: "Florida", |
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 requestMarkers() { | |
// no loading markers when zoomed way out | |
if (map.getZoom() < 11) { return }; | |
// start dropping markers before the browser bogs down | |
if (markers.length > 50) { | |
dropSuperfluousMarkers(); | |
} | |
$.ajax({ | |
// [snip typical ajax data request] | |
success: populateMarkers, |
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
// this is, obviously, just an apex exploration | |
// i.e. horribly inefficient | |
Integer fib(Integer n) { | |
if (n <= 1) return 1; else return fib(n-1) + fib(n-2); | |
} | |
for (Integer i=0; i<=12; i++) { | |
System.debug(fib(i)); | |
} |
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
# add "[git]" to the prompt if in a git directory | |
# example (normal dir): | |
# user@host:/PATH | |
# $ | |
# (in git directory) | |
# user@host:/PATH/GIT/PROJECT | |
# [git]$ | |
export PROMPT_COMMAND='_GIT_LABEL= ;[ -d ".git" ] && _GIT_LABEL="[git]"' | |
export PS1="\u@\h:\w\n\${_GIT_LABEL}\$ " |
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
<?php | |
/** | |
* Return CONTENTdm scaling of $width and $height to $maxwidth and $maxheight. | |
* | |
* @param string $width starting width | |
* @param string $height starting height | |
* @param string $maxwidth width limit | |
* @param string $maxheight height limit | |
* @return array dmscale, dmwidth, dmheight |
NewerOlder