Skip to content

Instantly share code, notes, and snippets.

View usmanity's full-sized avatar

Muhammad Usman usmanity

View GitHub Profile
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
@usmanity
usmanity / styleMe.js
Created February 8, 2012 00:13
Styles for some basic html pages
javascript:var style = document.createElement("style");
style.innerHTML = "@import url(http://usmanity.com/bootstrap.css);@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Rokkit); body{ font-family: 'Droid sans'; font-size: 14px; color: #444; background: #feefee; padding: 0 100px; } p{ font-family: 'Droid sans'; font-size: 14px; } h1,h2,h3,h4,h5,h6{ font-family: Rokkit, Rockwell, serif; color: #333; font-size: 125%; }";
document.body.appendChild(style);
void(0);
@usmanity
usmanity / text-shadow.css
Created February 10, 2012 22:09
text-shadow
text-shadow: 0 1px 0 white;
/* abandon vendor prefixes. */
@usmanity
usmanity / index.html
Created February 24, 2012 00:31
CSS and html to make footer stick to the bottom of the screen
<body>
<div id="container">
Container content.
</div>
<footer>
Footer content.
</footer>
</body>
@usmanity
usmanity / gist:2355218
Created April 10, 2012 22:44
development
O
<[ ]>
_/ \_ OTL OTL OTL OTL
@usmanity
usmanity / debug sess
Created August 7, 2012 05:52
debug sess
<%= debug(params) if Rails.env.development? %>
show = "show indent"
@usmanity
usmanity / color.js
Created November 1, 2012 04:59
random color in JS
var randomColor = function() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 15)];
}
return color;
};
@usmanity
usmanity / Aaron Swartz: Guerilla Open Access Manifesto
Created January 13, 2013 07:34
Aaron Swartz: Guerilla Open Access Manifesto (making a copy for public access and personal record)
Information is power. But like all power, there are those who want to keep it for themselves. The world’s entire scientific and cultural heritage, published over centuries in books and journals, is increasingly being digitized and locked up by a handful of private corporations. Want to read the papers featuring the most famous results of the sciences? You’ll need to send enormous amounts to publishers like Reed Elsevier.
There are those struggling to change this. The Open Access Movement has fought valiantly to ensure that scientists do not sign their copyrights away but instead ensure their work is published on the Internet, under terms that allow anyone to access it. But even under the best scenarios, their work will only apply to things published in the future. Everything up until now will have been lost.
That is too high a price to pay. Forcing academics to pay money to read the work of their colleagues? Scanning entire libraries but only allowing the folks at Google to read them? Providing scientific a
@usmanity
usmanity / battery_cycles.sh
Last active December 11, 2015 21:18
check battery cycles on macbook
ioreg -w0 -l | grep "Cycle" | tail -b 1