Skip to content

Instantly share code, notes, and snippets.

@chanified
chanified / less-chanified-padding-and-margin-helpers
Created July 26, 2014 05:55
Chanifed Padding and Margin Less Helper Classes
.chanified-size-loop (@i) when (@i >= 0) {
/* Margins */
.p@{i} {
padding:~"@{i}px" !important;
}
.pt@{i} {
padding-top:~"@{i}px" !important;
}
.pr@{i} {
padding-right:~"@{i}px" !important;
require.config({
paths: {
/* other paths are omitted */
'bootstrap': '../libs/bootstrap'
},
shim: {
'bootstrap/affix': { deps: ['jquery'], exports: '$.fn.affix' },
'bootstrap/alert': { deps: ['jquery'], exports: '$.fn.alert' },
'bootstrap/button': { deps: ['jquery'], exports: '$.fn.button' },
'bootstrap/carousel': { deps: ['jquery'], exports: '$.fn.carousel' },
@mnewt
mnewt / bootstrap-tabs.html
Created December 6, 2012 20:28
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
@redoPop
redoPop / suffix.js
Created February 24, 2010 19:39
JavaScript: integer suffixes (1st, 2nd, 3rd...)
var suffix = function(n) {
var d = (n|0)%100;
return d > 3 && d < 21 ? 'th' : ['th', 'st', 'nd', 'rd'][d%10] || 'th';
};
// suffix(1) => "st"
// suffix(102) => "nd"
// suffix(113) => "th"