Skip to content

Instantly share code, notes, and snippets.

View awkale's full-sized avatar
📈
developing

Alex Kale awkale

📈
developing
View GitHub Profile
@awkale
awkale / Masonry---calc()-sizing.markdown
Created January 14, 2014 21:34
Masonry - calc() sizing - fixed gutter, % column
@awkale
awkale / resposive-table.html
Created January 15, 2014 19:53
responsive table with multi columns to one column on mobile
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title></title>
<style type="text/css" media="all">
/* Mobile-specific Styles */
@media only screen and (max-width: 480px) {
@awkale
awkale / checkall.js
Created April 21, 2014 18:59
checkbox select all
$(function () {
$('.checkall').on('click', function () {
$(this).closest('fieldset').find(':checkbox').prop('checked', this.checked);
});
});
@awkale
awkale / caffeinate.sh
Last active August 29, 2015 14:00
caffeinate - disable screensaver for ## length of time (in seconds)
caffeinate -t 3600 &
@awkale
awkale / pmset.sh
Created May 2, 2014 14:29
find out what is preventing sleep
pmset -g
@awkale
awkale / scrollspy-offset.js
Created June 10, 2014 18:50
anchor scroll offset
// amount to offset
var offset = 80;
// offsets the anchor link by the desired amount from the top of the browser
$('.navbar li a').click(function(event) {
event.preventDefault();
$($(this).attr('href'))[0].scrollIntoView();
scrollBy(0, -offset);
});
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
@awkale
awkale / gist:9d06ed885dde04bb2a74
Created August 25, 2014 03:16
disk usage in human readable, not recursive
du -h --max-depth=1
@awkale
awkale / js dates.js
Created October 1, 2014 16:03
javascript dates
getDate() Returns the day of the month (from 1-31)
getDay() Returns the day of the week (from 0-6)
getFullYear() Returns the year (four digits)
getHours() Returns the hour (from 0-23)
getMilliseconds() Returns the milliseconds (from 0-999)
getMinutes() Returns the minutes (from 0-59)
getMonth() Returns the month (from 0-11)
getSeconds() Returns the seconds (from 0-59)
@awkale
awkale / anchor.css
Created October 7, 2014 15:11
anchor padding - adds padding to jump-to anchors
h2:before {
display: block;
content: " ";
margin-top: -285px;
height: 285px;
visibility: hidden;
}