Skip to content

Instantly share code, notes, and snippets.

@amboy00
amboy00 / myScriptyStuff.js
Last active August 29, 2015 13:58
One way to use RWD in JS.
jQuery(function ($) {
var width = window.innerWidth ? window.innerWidth : $(window).width(),
height = window.innerHeight ? window.innerHeight : $(window).height(),
touch = Modernizr.touch;
var breakpoint = function() {
if (width < 768) {
return 'small';
} else if (width < 992 ) {
<div class="dropdown-wrapper">
<a href="#" class="has-dropdown" data-bind="dropdown: {}, text: someObservable"></a>
<div class="dropdown">
<div class="options" data-bind="foreach: list">
<div><a href="#" data-bind="text: $data, click: function() { $root.doThisFunction($data) }"></a></div>
</div>
</div>

Keybase proof

I hereby claim:

  • I am amboy00 on github.
  • I am martinilab (https://keybase.io/martinilab) on keybase.
  • I have a public key whose fingerprint is E296 376A 05EB 8C2D AD3D 5863 4EBF 3805 FDF0 8127

To claim this, I am signing this object:

function listToMatrix(list, elementsPerSubArray) {
var matrix = [], i, k;
for (i = 0, k = -1; i < list.length; i++) {
if (i % elementsPerSubArray === 0) {
k++;
matrix[k] = [];
}
matrix[k].push(list[i]);
@amboy00
amboy00 / grid.css
Created March 6, 2014 22:27
Sets a nice blue line every 20 pixels
div {
background-image: -webkit-linear-gradient(top, rgba(0,0,0,0) 95%, rgba(56,255,255,.8) 100%);
background-size: 100% 20px;
background-position: 10px 0px;
}
@amboy00
amboy00 / watch.sh
Created February 17, 2014 16:12
Easy way to use Sass in the CLI and output a map file at the same time.
sass --compass --sourcemap --watch sass/swa.scss:css/swa.css
<link href="http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic" rel="stylesheet" type="text/css">
<!--[if IE]>
<link href="http://fonts.googleapis.com/css?family=Droid+Serif" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Droid+Serif:400italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Droid+Serif:700" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Droid+Serif:700italic" rel="stylesheet" type="text/css">
<![endif]-->
@amboy00
amboy00 / anchors.js
Created January 28, 2014 21:36
Hunting anchors.
//This is how we make the link work.
var el = ev.target;
while (el.parentNode) {
el = el.parentNode;
if (el.nodeName == 'A') {
window.location.href = el.getAttribute('data-href');
}
}
@amboy00
amboy00 / _hero-medium.less
Created January 15, 2014 17:37
IE8 support
// _hero-medium.less
.hero-medium {
// medium screen code
}
@amboy00
amboy00 / SWAAS
Created December 19, 2013 14:48
Star Wars as a service
___________ __ _________ _______ _______.
/ \ / \ / __ \ |__ \ / |
| (-----\ \/ \/ / / ^ \ / ^ \ | (----`
\ \ \ / / /_\ \ / /_\ \ \ \
.----) | \ /\ / / _____ \ / _____ \----) |
|_______/ \__/ \__/ /__/ \__\ /__/ \_________/
**Star Wars As A Service**