Skip to content

Instantly share code, notes, and snippets.

View jordanmoore's full-sized avatar

Jordan Moore jordanmoore

View GitHub Profile
@jordanmoore
jordanmoore / RWD Screen Width Indicator
Created July 19, 2012 13:17
Current screen width indicator (useful for knowing when to add breakpoints when resizing browser window)
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
$('.screen-width').text(windowWidth + 'px');
});
</script>
<div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;">
<span class="screen-width">0</span>
</div>
@jordanmoore
jordanmoore / RWD Screen Width Indicator (em version)
Created July 19, 2012 14:05
Current screen width indicator in EMs (useful for knowing when to add breakpoints when resizing browser window)
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
var bodyFontSize = $('body').css('font-size');
var bodyFontSizeWithoutPx = parseInt(bodyFontSize);
var emValue = windowWidth/bodyFontSizeWithoutPx;
$('.screen-width').text(emValue + 'em');
});
</script>
@jordanmoore
jordanmoore / conditional-css-inc-ie.html
Created August 8, 2012 14:55
Context-based loading JavaScript using CSS media query breakpoints
<script type="text/javascript">
var LegacyIE = {
Version: function() {
var version = 999;
if (navigator.appVersion.indexOf("MSIE") != -1)
version = parseFloat(navigator.appVersion.split("MSIE")[1]);
return version;
}
}
if (LegacyIE.Version() <= 8) {
@jordanmoore
jordanmoore / RWDEE
Created November 28, 2012 16:38
Responsive Images in WYSIWYG fields in Expression Engine
{!-- Entry template --}
{exp:channel:entries channel="YOUR-CHANNEL-NAME" url_title="{embed:url_title}" limit="1" disable="categories|member_data" dynamic="off"}
<hr>
{exp:low_replace
find="{overview_images backspace="1"}[image{row_count}]|{/overview_images}"
replace="{overview_images backspace="1"}{embed=shared/_inline_image number='{row_count}' url_title='{url_title}' channel='YOUR-CHANNEL-NAME' field_name='overview_images'}|{/overview_images}"
multiple="yes"
}
@jordanmoore
jordanmoore / print_github.js
Created December 4, 2012 10:26 — forked from robcowie/print_github.js
Github print styling bookmarlet
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd=="loaded"%7C%7Cd=="complete"))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.3.2",function($,L)%7B$('%23header, .header, .pagehead, .breadcrumb, .commit, .meta, %23footer, %23footer-push').remove(); $('%23files, .file').css(%7B"background":"none", "border":"none"%7D); $('link').removeAttr('media');%7D);
@jordanmoore
jordanmoore / Better Emmet Media Queries
Created November 18, 2013 10:08
Go to Preferences > Browse Packages > Emmet > Emmet.sublime-settings and add this between the curly brackets under snippets for writing better media queries quickly in Emmet. mqm => min-width media query mqx => max-width media query
"css": {
"abbreviations": {
"mqm": "@media screen and (min-width:${1}) {\n\t|\n}",
"mqx": "@media screen and (max-width:${1}) {\n\t|\n}"
}
}
@jordanmoore
jordanmoore / Emmet VSCode Better Media Query snippet
Last active September 27, 2019 13:52
A better default for the "@m" abbreviation
"Min-width media query" : {
"prefix": "@m",
"body": [
"@media (${1:min-width}: ${2}px) {",
"\t${3} {",
"\t\t$0",
"\t}",
"}"
],
"description": "Media Query"
@jordanmoore
jordanmoore / audio_log-prompt.txt
Last active June 20, 2023 20:44
Audio Log - Title & Summarise prompt for GPT-4 in Reflect
First, suggest a title for the text in triple quotes and prepend with a "- ###".
Then, summarize the text in triple quotes but keep it concise. Summarize using plain and simple language and keep the same tense and keep first-person references like "I". Then, prepend the summary with a "- ". Finally, add the full original text after the summary in this format:
"- #### Transcript
- {{selectedText}}"
"""
{{selectedText}}
"""