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
body:before { | |
position: fixed; | |
content: "No Breakpoint"; | |
background: white; | |
color:black; | |
line-height: 1; | |
text-align: center; | |
white-space: nowrap; | |
vertical-align: baseline; |
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 colorText(str) { | |
var phase = 0; | |
var outputStr = new Array(); | |
var args = new Array(); | |
var center = 128; | |
var width = 127; | |
var frequency = Math.PI*2/str.length; | |
var red, green, blue, i; | |
function componentToHex(c) { |
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
// Returns a function, that, when invoked, will only be triggered at most once | |
// during a given window of time. Normally, the throttled function will run | |
// as much as it can, without ever going more than once per `wait` duration; | |
// but if you'd like to disable the execution on the leading edge, pass | |
// `{leading: false}`. To disable execution on the trailing edge, ditto. | |
// Replaced namespace and _.now function to function scope | |
// https://github.com/jashkenas/underscore/blob/master/underscore.js#L779 | |
function throttle(func, wait, options) { |
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
/* | |
JavaScript Test | |
--------------- | |
A small script to open a popup when clicking a link. | |
Once you click on the button, clinking on it again will close the popup. | |
*/ | |
/* Task One - Improve this code |
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
// The expensive animation is causing performance issues. Write the function 'yourFunction' that reduces calls to the animation. | |
function scrollHandler() { | |
var items = document.querySelectorAll('.list-item'); | |
var i = 0; | |
var len = items.length; | |
for(; i < len; i++) { | |
// perform expensive animation | |
} |
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
j=0; for i in *.png; do ((j = $j+1)); k=$j".png"; mv $i $k; done |
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
app.get('/help', function(req, res){ | |
res.send('some help'); | |
}); | |
app.get('/search/:query/p:page', function(req, res){ | |
var query = req.params.query | |
, page = req.params.page; | |
res.send('search "' + query + '", page ' + (page || 1)); | |
}); |
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
$.fn.raty.defaults.click = function(s,e) { | |
$(this).siblings(".text").text(s); | |
}; | |
<div class="star"></div><p class="text"></p> | |
$(".star").each(function(i) { | |
var target = $(this); | |
target.raty({scoreName: "score" + i}) |
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
<form action="/login" method="post" class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label" for="inputEmail">Email:</label> | |
<div class="controls"> | |
<input type="email" name="email" placeholder="someone@example.com" /> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="password">Password</label> | |
<div class="controls"> |
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://blog.jonnay.net/archives/423-More-ASCII-Bunnies..html | |
(\(\ | |
( - -) | |
((') (') | |
(\_/) | |
('.') | |
(')(') |
OlderNewer