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 / bulk-unfollow-quora.js
Created February 21, 2014 19:57
Bulk unfollow questions in Quora
unfollowLinks = $('.follow_question.unfollow_question');
$.each(unfollowLinks, function(index, link) { $(link).delay(2000).trigger("click"); });
@aniketpant
aniketpant / script.sh
Last active August 29, 2015 13:57
Install AMD Catalyst Legacy on Ubuntu 12.04
# The following script has been taken from https://launchpad.net/~makson96/+archive/fglrx
# If you are using Ubuntu 12.04.2 make sure you got linux-headers-generic-lts-quantal package installed.
# sudo apt-get install linux-headers-generic-lts-quantal
sudo add-apt-repository ppa:makson96/fglrx
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fglrx-legacy
sudo reboot
@aniketpant
aniketpant / delete-empty-dirs.sh
Created April 8, 2014 01:15
Delete all empty directories
$ find . -empty -type d -delete
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@aniketpant
aniketpant / SassMeister-input.scss
Created June 30, 2014 08:57
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
$baseColor: #FFCC00;
@for $i from 1 to 5 {
#mainbody :nth-child(#{$i}) {
border-color: adjust-color($baseColor, $green: ($i - 1) * 1);
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying