Skip to content

Instantly share code, notes, and snippets.

View shrwnsan's full-sized avatar
🏠
Working from home

shrwnsan

🏠
Working from home
View GitHub Profile
@shrwnsan
shrwnsan / gist:2860805
Created June 3, 2012 01:14
Sublime Text 2 - Fetch Settings
{
"files":
{
"jquery" : "http://code.jquery.com/jquery.js",
"jquery.min" : "http://code.jquery.com/jquery.min.js",
"jquery-cookie" : "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js",
"jquery-dotimeout" : "https://raw.github.com/cowboy/jquery-dotimeout/master/jquery.ba-dotimeout.min.js",
"jquery-extra-selectors" : "https://raw.github.com/keithclark/JQuery-Extended-Selectors/master/jquery-extra-selectors.js",
"jquery-flexslider" : "https://raw.github.com/mbmufffin/FlexSlider/master/jquery.flexslider-min.js",
"jquery-mediaelement" : "https://raw.github.com/johndyer/mediaelement/master/build/mediaelement-and-player.js",
@shrwnsan
shrwnsan / bkg-gradient.less.css
Last active October 11, 2015 23:38
Patterns: LessCSS Mixins & Functions
// Simple background gradient; 2-colors
.background-gradient (@start-color: #BE5B63, @end-color: #7F1C24) {
// Generated via http://j.mp/ROBdww (CSSGradientButton.com)
background-color: @start-color;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @start-color), color-stop(100%, @end-color));
background-image: -webkit-linear-gradient(top, @start-color, @end-color);
background-image: -moz-linear-gradient(top, @start-color, @end-color);
background-image: -ms-linear-gradient(top, @start-color, @end-color);
background-image: -o-linear-gradient(top, @start-color, @end-color);
background-image: linear-gradient(top, @start-color, @end-color);
@shrwnsan
shrwnsan / .profile
Last active October 11, 2015 23:38
Git Info — Almost Like “svn info”. Write up via http://justamemo.com/2009/02/09/git-info-almost-like-svn-info/
alias gi='. /Users/$USER/git-info.sh'
@shrwnsan
shrwnsan / GitHub Gists CSS
Created October 23, 2012 08:51 — forked from tnylea/GitHub Gists CSS
CSS to add un-selectable line numbers to your github gists
.gist .highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist .highlight pre { counter-reset: linenumbers; }
.gist .highlight pre div:before {
color: #aaa;
content: counter(linenumbers);
counter-increment: linenumbers;
left: -4ex;
@shrwnsan
shrwnsan / .bash_profile
Created November 7, 2012 16:17
My basic custom-bash files
# ~/.bash_profile: executed by bash(1) for login shells.
umask 002
PS1='\e[7m[\!] `whoami` @ \h\e[34;47;7;1m \w \e[0m
> '
alias cls="clear"
alias mytree="find . -type d | sed -e 1d -e 's/[^-][^\/]*\//--/g' -
e 's/^/
/' -e 's/-/|-/' | more"
alias ls="ls --color=auto"
@shrwnsan
shrwnsan / step1.sh
Created November 9, 2012 18:09
Convert SVN repository to Git
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
@shrwnsan
shrwnsan / retina.css
Created November 30, 2012 12:35
Retina/high resolution media query
/* Clean version examples */
/* 1.25 dpr */
@media
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi){
/* Retina-specific stuff here */
}
/* 1.3 dpr */
@shrwnsan
shrwnsan / jquery.js
Created January 9, 2013 17:16
IE8 tweaks/workarounds
// lack of support for CSS :first-child and :last-child
if ($.browser.msie && parseInt($.browser.version, 10) === 8) {
$('ul li:first').addClass('first');
$('ul li:last').addClass('last');
}
@shrwnsan
shrwnsan / online-offline-demo.html
Created March 4, 2013 01:34
Treehouse Web Standard Technology Quick Tip: Online / Offline Demo As seen at: http://www.youtube.com/watch?v=8y7O-5TnCUg
<!doctype html>
<html>
<head>
<title>Online / offline Demo<title>
<style>
body { background: #6c6; }
body.offline { background: #ccc; }
.container {
width: 500px;
background: #fff;
@shrwnsan
shrwnsan / best-available-ampersand.js
Created March 12, 2013 18:34
Based on Dan Cederholm's http://simplebits.com/notebook/2008/08/14/ampersands-2/ Crafted this years back to take care of rogue's that the WordPress plugin WP-Typography couldn't take care of, e.g. ampersands, due to priority parsing of the markup.
jQuery(document).ready(function() {
jQuery('#content div.entry div.info h2 a').each(function() {
var new_text = jQuery(this).html().replace(/&amp;/g, '<span class="amp">&amp;</span>');
jQuery(this).html(new_text);
});
});