Skip to content

Instantly share code, notes, and snippets.

🕹

Max Glenister omgmog

🕹
Block or report user

Report or block omgmog

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@omgmog
omgmog / gist:1836735
Created Feb 15, 2012
Specific case for breaking up page in to slides that slide in/out of viewport.
View gist:1836735
$(function(){
$("section.page").hide();
var hash = window.location.hash;
if(hash){
$('a[href$="'+hash+'"]').parent().addClass('active').siblings('li.active').removeClass("active");
$('section'+hash).show();
console.log(hash);
check_for_dark($('section'+hash));
}else{
@omgmog
omgmog / .screenrc
Created Mar 27, 2012
my .screenrc, goes in ~/.screenrc
View .screenrc
startup_message off
screen -t serve
screen -t git
select 0
autodetach on
term screen-256color
termcapinfo xterm-256color|xterm-color|xterm|xterms|xs|rxvt ti@:te@
altscreen on
hardstatus on
@omgmog
omgmog / jquery_disqus_lazyload.js
Created Apr 5, 2012 — forked from muratcorlu/jquery_disqus_lazyload.js
Load disqus comments when visitor scroll down page to comments
View jquery_disqus_lazyload.js
/**
* Load disqus comments when visitor scroll down page to comments
*
* Usage:
* Add a div with id "disqus_thread" and data attributes for every disqus parameter:
*
* <div id="disqus_thread" data-disqus-shortname="username" data-disqus-url="http://example.com/post/post-name/"></div>
*
* @author: Murat Corlu
* @link: https://gist.github.com/gists/2290198
@omgmog
omgmog / gist:2420059
Created Apr 19, 2012
Bulk recursive find/replace in terminal with perl/grep
View gist:2420059
perl -pi -w -e 's/<search string>/<replace string>/g;' `grep -ril "<search string>" *`
@omgmog
omgmog / gist:2421164
Created Apr 19, 2012
gatt - git all the things!
View gist:2421164
# place this in your ~/.bashrc
# restart terminal, or run 'source ~/.bashrc'
# use `gatt` command like a bowss
# ???
# Profit!
# name/idea/demand from @tmayr
# gatt "branch" "message"
# or
# gatt "message"
@omgmog
omgmog / gist:2690184
Created May 13, 2012
jQuery snippet for embedding YouTube videos with custom thumbnails
View gist:2690184
$(function(){
$('.ytembed:not(.processed)').addClass('processed').each(function() {
$(this).find('a').click(function(e) {
e.preventDefault();
var width = $(this).find('img').width();
var height = $(this).find('img').height();
var url = $(this).attr('href');
var $iframe = $('<iframe src="'+url+'" width="'+width+'" height="'+height+'" frameborder="0"/>');
$(this).parent().html($iframe);
});
@omgmog
omgmog / gist:2690199
Created May 13, 2012
HTML to accompany the jQuery at gist:2690184
View gist:2690199
<!-- you need a div with the class 'ytembed' -->
<div class="ytembed">
<!-- put a link with the url + embed options of your video -->
<a href="http://www.youtube.com/watch?v=dQw4w9WgXcQ?rel=0&amp;showinfo=0&amp;autohide=1&amp;autoplay=1&amp;wmode=transparent">
<!-- and a thumbnail, with the width/height specified -->
<img width="560" height="315" src="/path/to/custom_thumbnail.jpg" alt="Click to play"/>
</a>
</div>
@omgmog
omgmog / snippet.md
Created Jun 20, 2012 — forked from harthur/snippet.md
console.log() key binding for Sublime Text
View snippet.md

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
    }
@omgmog
omgmog / gist:3040431
Created Jul 3, 2012
workdone [time period] [committer email]
View gist:3040431
# Usage:
# workdone [time period] [committer email]
workdone(){
default="1 day ago"
email="[your email here]"
git log --committer=${2:-$email} --pretty=format:"%Cgreen%ar (%h)%n%Creset> %s %b%n" --since="${1:-$default}" --no-merges
}
View .screenrc
startup_message off
screen -t serve
screen -t git
select 0
autodetach on
term screen-256color
termcapinfo xterm-256color|xterm-color|xterm|xterms|xs|rxvt ti@:te@
altscreen on
hardstatus on
You can’t perform that action at this time.