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
-- I'm using this code in an survival game similar to one of those high speed motor way games | |
local backgroundTiles = {} | |
-- drawBackground() | |
-- The same 480x320 image is used twice | |
local drawBackground = function() | |
backgroundTiles[0] = display.newImageRect( "images/background.jpg", display.contentWidth, display.contentHeight) | |
backgroundTiles[0].x = display.contentCenterX | |
backgroundTiles[0].y = display.contentCenterY |
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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
body | |
{ | |
margin:40px; | |
} |
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 fruit = ["apple", "banana", "coconut"]; | |
fruit.reverse().push("melon"); | |
fruit.reverse(); | |
//fruit array should now be ["melon", "apple", "banana", "coconut"]; |
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
/*! | |
* jquery.backgroundcover.js | |
* https://github.com/duncanmcdougall/jQuery-Background-Cover | |
* Copyright 2013 Duncan McDougall and other contributors; Licensed MIT | |
*/ | |
; (function ($) { | |
'use strict'; | |
$.fn.backgroundCover = function () { |
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 matchHeights(selector) { | |
$(selector).height(''); | |
var maxHeight = 0; | |
$(selector).each(function (idx, item) { | |
if ($(item).outerHeight() > maxHeight) { | |
maxHeight = $(item).outerHeight(); | |
} | |
}); | |
if (maxHeight > 0) { | |
$(selector).outerHeight(maxHeight); |
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
#element{ | |
background-image: url('/images/sprite.png'); | |
background-repeat: no-repeat; | |
background-position: -3px 0; | |
} | |
@media (min--moz-device-pixel-ratio: 1.25), | |
(-webkit-min-device-pixel-ratio: 1.25), | |
(min-device-pixel-ratio: 1.25), | |
(min-resolution: 1.25dppx) { |
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 ($) { | |
$.fn.update = function () { | |
var newElements = $(this.selector, this.context), i, oldLength = this.length; | |
this.length = newElements.length; | |
for (i = 0; i < this.length; i++) { | |
this[i] = newElements[i]; | |
} | |
for (; i < oldLength; i++) { | |
this[i] = undefined; | |
} |
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
/* http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */ | |
*, *:before, *:after { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
*behavior: url(/css/boxsizing.htc); /* IE6/7 Fix - Get from http://github.com/Schepp/box-sizing-polyfill */ | |
} |
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
USE master | |
GO | |
DECLARE @sqlBase nvarchar(300) = 'ALTER AUTHORIZATION ON database::XXXXX TO sa'+char(13)+char(10) | |
DECLARE @sql nvarchar(max)='' | |
SELECT @sql = @sql + REPLACE(@sqlBase,'XXXXX',name) from sys.databases | |
where name not in ('master', 'model', 'tempdb', 'distribution', 'msdb') | |
EXECUTE(@sql) |
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
.main-header { | |
.nav { | |
background-color: black; | |
ul { | |
li { | |
display: inline-block; | |
a { |
OlderNewer