Skip to content

Instantly share code, notes, and snippets.

@shodanuk
shodanuk / .jsbeautifyrc
Created March 8, 2017 21:50 — forked from thevirtualforge/.jsbeautifyrc
JS-Beautify config to aid enforcement of VF Javascript style guidelines
{
"indent_size": 4,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
@shodanuk
shodanuk / .editorconfig
Created March 8, 2017 21:49 — forked from thevirtualforge/.editorconfig
Standard .editorconfig file to help enforce code standards
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@shodanuk
shodanuk / gist:2199360
Created March 25, 2012 19:55
Quick and dirty input placeholder shim using jQuery + Modernizr (Tested in IE7 + 8)
$('.lt-ie9 input[placeholder], .lt-ie9 textarea[placeholder]').each(function(){
var $this = $(this),
placeholder = $this.attr('placeholder');
$this.addClass('placeholder').val(placeholder);
$this.focus(function() {
$this.val('');
}).blur(function() {
if ($this.val() === '') {
@shodanuk
shodanuk / transitionCss.js
Created March 18, 2012 10:35
Generate cross browser transitons CSS (includes custom easing functions)
/**
* Create cross browser transition CSS
*
* @param {Integer} duration Duration in milliseconds.
* @param {String} easing Easing function. Can be built-in CSS3 function or one of the provided custom functions.
* @param {String} prop CSS property to apply transition to.
*/
function transitionCss(duration, easing, prop) {
var easingDefs = {
easeInCubic : 'cubic-bezier(0.550, 0.055, 0.675, 0.190)',
@shodanuk
shodanuk / countriesbyregion.json
Created December 20, 2011 20:19
JSON object containing countries sorted by rough geographical region (2 digit ISO codes)
{
"westEurope": [
"AD",
"DE",
"ES",
"FR",
"IT",
"AT",
"BE",
"CH",
@shodanuk
shodanuk / Shodan.UI.Slideshow.html
Created March 6, 2011 22:32
Example HTML markup for the Shodan.UI.Slideshow component
<div id="slideshow-demo">
<img src="images/slideshow/Pensive Parakeet.jpg" alt="Slide 1" />
<img src="images/slideshow/Random-Penguins-random-16779663-1024-768.jpg" alt="Slide 2" />
<img src="images/slideshow/Random-Wallpapers-random-10799667-1024-768.jpg" alt="Slide 3" />
<img src="images/slideshow/Random-Wallpapers-random-10799672-1024-768.jpg" alt="Slide 4" />
</div>
@shodanuk
shodanuk / Shodan.UI.Slideshow.js
Created March 6, 2011 22:34
Example Javascript to invoke Shodan.UI.Slideshow
$(document).observe('dom:loaded', function(){
new Shodan.UI.Slideshow('slideshow-demo');
});
<div id='sh-ui-accordion-demo'>
<ul class="root">
<li>
<div class='hd'>
<h3>Item 1</h3>
</div>
<ul class='sub'>
<li>
<div class='inner'>Item 1 child 1</div>
</li>
$(document).observe('dom:loaded', function(){
new Shodan.UI.Accordion('sh-ui-accordion-demo');
});
@shodanuk
shodanuk / Shodan.UI.SlideyPanel.js
Created February 21, 2011 15:46
Example Javascript for Shodan.UI.Slidey demo
$(document).observe("dom:loaded", function(){ // wait for DOM to load
new Shodan.UI.SlideyPanel('sh-ui-slidey-demo');
});