Skip to content

Instantly share code, notes, and snippets.

View aniketpant's full-sized avatar
WHAT

Aniket Pant aniketpant

WHAT
View GitHub Profile
@aniketpant
aniketpant / misc.sh
Created July 14, 2016 11:58
Useful terminal commands for osx
# generate a lowercase UUID
uuidgen | tr '[:upper:]' '[:lower:]'
# generate a random number between min and max
awk -v min=7000000000 -v max=9000000000 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
# copy to pasteboard after trimming endline
tr -d '\n' | pbcopy
@aniketpant
aniketpant / set-network-name.sh
Created February 25, 2016 06:25
Set network names on OSX
scutil --set ComputerName "Tekina"
scutil --set HostName "Tekina"
scutil --set LocalHostName "Aniket"
@aniketpant
aniketpant / todo.html
Created January 16, 2014 11:09
Another tiny todo demo using Backbone.js
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Spinal</title>
<meta name="description" content="Learning backbone.js">
@aniketpant
aniketpant / Old-is-gold.markdown
Created November 21, 2013 10:02
A Pen by Aniket Pant.
@aniketpant
aniketpant / luhn.js
Created November 11, 2013 04:26
Bank Card Validation Tests
function luhn_checksum( cardNumber ) {
var checkDigit = cardNumber % 10;
var checksumNumber = parseInt( cardNumber / 10 ).toString();
var digits = checksumNumber.length;
var sum = 0,
digit,
tempNumber;
for ( var i = 0; i < digits; i++ ) {
@aniketpant
aniketpant / skrum.zsh-theme
Created September 1, 2013 06:27
My custom ZSH theme
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
# git settings
RPS1='$(git_prompt_info)'
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
@aniketpant
aniketpant / base.md
Last active December 22, 2015 02:19
Inspiration

A list of all the inspiring work I get to see around the web. Starting this document as a gist, might take it to my blog later or it might soon end up as a repository.

@aniketpant
aniketpant / remove-gpg-errors.sh
Created June 28, 2013 04:21
[Ubuntu] Script to remove GPG errors which occur during update.
sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get clean
sudo apt-get update
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@aniketpant
aniketpant / index.html
Created June 6, 2013 14:35
A CodePen by herbnerder. Styling adjacent links - It can be hard to tell two links apart when they are directly adjacent to each other. It is even harder when you remove the underline (the spaces between links help). Make sure to account for it somehow.
<h1>Styling Adjacent Links</h1>
<p class="contrast">People like to remove link underlines because they are seen as ugly. But, people also <a href="#">like to do that thing</a> <a href="#">where they link up several adjacent strings</a> of text or <a href="#">even</a> <a href="#">make</a> <a href="#">each</a> <a href="#">word</a> <a href="#">a</a> <a href="#">different</a> <a href="#">link.</a></p>
<p><a href="#">Linking that way</a> <a href="#">lets you fit a lot of info</a> <a href="#">into a small space.</a> <a href="#">But if you are removing the underlines,</a> <a href="#">it becomes hard to tell</a> <a href="#">that they are even separate links.</a></p>
<p class="underline"><a href="#">You</a> <a href="#">could</a> <a href="#">just</a> <a href="#">leave</a> <a href="#">the</a> <a href="#">underline</a> <a href="#">alone.</a></p>
<p>But, if you insist, maybe you could at least give every 2nd link a slightly differently treatment so that users can tell them apart?</p>