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 foo(a, b) | |
{ | |
a = typeof a !== 'undefined' ? a : 42; | |
b = typeof b !== 'undefined' ? b : 'default_b'; | |
... | |
} |
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
$.fn.isOnScreen = function(){ | |
var win = $(window); | |
var viewport = { | |
top : win.scrollTop(), | |
left : win.scrollLeft() | |
}; | |
viewport.right = viewport.left + win.width(); | |
viewport.bottom = viewport.top + win.height(); |
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 | |
class a | |
{ | |
var $arr = array(); | |
function set() | |
{ | |
$args = func_get_args(); | |
$last = array_pop( $args ); |
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
smart_ajax({ | |
url: document.location.href, | |
type: 'POST', | |
data: q, | |
dataType: 'json', | |
error: function(){ alert('Error while trying to connect to server') }, | |
success: function(json){ | |
if(json.ok == true){ | |
}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
<style> | |
.marked{ | |
background-color: #FEE65F; | |
display: inline-block; | |
position: relative; | |
top: -1px; | |
} | |
</style> | |
<script> |
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 windowOpener(windowHeight, windowWidth, windowName, windowUri) | |
{ | |
var centerWidth = (window.screen.width - windowWidth) / 2; | |
var centerHeight = (window.screen.height - windowHeight) / 2; | |
newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + | |
',height=' + windowHeight + | |
',left=' + centerWidth + | |
',top=' + centerHeight); |
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
.boxsizingBorder { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} |
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
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^rankoholic\.com$ [NC] | |
RewriteRule ^(.*)$ http://rankoholic.com/$1 [R=301,L] |
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
SELECT * FROM | |
( | |
select * from `my_table` order by timestamp desc | |
) as my_table_tmp | |
group by catid | |
order by nid desc |
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 isVisible = false; | |
$(window).scroll(function(){ | |
var shouldBeVisible = $(window).scrollTop()>200; | |
if (shouldBeVisible && !isVisible) { | |
isVisible = true; | |
$('#mybutton').show(); | |
} else if (isVisible && !shouldBeVisible) { | |
isVisible = false; | |
$('#mybutton').hide(); | |
} |