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
var getShortDateFormat = (function() { | |
var pattern = undefined, | |
defaultPattern = "M/d/yyyy", | |
localeFormatMappings = { | |
"en-us": "M/d/yyyy", | |
"ja-jp": "yyyy\u5E74 M\u6708 d\u65E5" | |
}; | |
return function(date, locale) { | |
var m, d, y; |
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
<div class="ms-MenuUIPopupBody ms-MenuUIPopupScreen" style="position:absolute;"> | |
<div class="ms-MenuUIPopupInner" style="overflow-x: visible; overflow-y: visible; "> | |
<div class="ms-MenuUILarge"> | |
<ul class="ms-MenuUIUL"> | |
<li class="ms-MenuUIULItem"> | |
<div class="ms-MenuUIULItem"> | |
<a class="ms-MenuUIULLink"> | |
<span class="ms-MenuUIIconLarge" style="white-space: nowrap;"> | |
<img class="ms-MenuUIULImg" width="32" height="32" src="/_layouts/images/blank.gif" alt="" 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> | |
<meta charset="utf-8" /> | |
<title>Canvas Hexagonal Map</title> | |
<style type="text/css"> | |
canvas { | |
border:0; | |
display:block; | |
margin:0 auto; |
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
// These functions assume that fib(0) = 0, fib(1) = 1 | |
// In other words, 0 and 1 are the seeds of the sequence. | |
function recursiveFib(n) { | |
if(n < 0) { | |
throw "Negative numbers are not allowed."; | |
} | |
if(n < 2) { | |
return n; |
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
uniform sampler2D texture; | |
uniform sampler2D colorTable; | |
uniform float paletteIndex; | |
void main() | |
{ | |
vec2 pos = gl_TexCoord[0].xy; | |
vec4 color = texture2D(texture, pos); | |
vec2 index = vec2(color.r + paletteIndex, 0); | |
vec4 indexedColor = texture2D(colorTable, index); |
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
var objectA = { a: '1a', b: '1b', c: '1c' }; | |
var objectB = { a: '2a', b: '2b', d: '2d' }; | |
function objectDifference(minuend, subtrahend) { | |
var firstIntersection = _.omit(minuend, _.keys(subtrahend)), | |
secondIntersection = _.omit(subtrahend, _.keys(minuend)); | |
return _.extend(firstIntersection, secondIntersection); | |
} |
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
case class Identifier(id: Long) | |
case class Rectangle(x: Int, y: Int, width: Int, height: Int) | |
object QuadTree { | |
private val MAX_OBJECTS = 2 | |
private val MAX_LEVELS = 5 | |
private val PARENT_NODE = -1 | |
private val TOP_RIGHT = 0 | |
private val TOP_LEFT = 1 |
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
#include <iostream> | |
constexpr auto bit(std::size_t index) { | |
return 1ULL << index; | |
} | |
int main() { | |
std::cout << bit(0) << "\n" << bit(1) << "\n" << bit(5) << std::endl; | |
return 0; | |
} |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
queryParams: { | |
'number': '_number' | |
}, | |
_number: 1, | |
totalPages: 5, | |
number: Ember.computed('_number', { |
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
var arr1 = [ | |
['1', '2', '3', '4'], | |
['5', '6', '7', '8'], | |
['9', 'a', 'b', 'c'], | |
['d', 'e', 'f', 'g'], | |
]; | |
function rotCCW(arr) { | |
var n = arr.length; | |
var ret = new Array(n); |
OlderNewer