Skip to content

Instantly share code, notes, and snippets.

/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
@sohyl87
sohyl87 / jQuery: append JS file to <head>
Last active April 24, 2019 03:54
Append JS file to the Head or body from anywhere (footer) in the page
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
@sohyl87
sohyl87 / PHP: parse tweets (replace links,hashtags,& user mentions)
Last active July 20, 2018 18:55
Parse Tweets when they are fetched from twitter such that links, user mention, & hashtags are linked & are not just text.
@sohyl87
sohyl87 / jQuery: create div & append to
Last active December 18, 2015 16:49
Create div & append to another div body using jQuery.
$('<div />', {
'class': 'clearfix',
html: "<section><img src='{source}' width='80'></section>"
}).appendTo('#foo');