Skip to content

Instantly share code, notes, and snippets.

View saxenanurag's full-sized avatar
🐍
import this

Anurag Saxena saxenanurag

🐍
import this
View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@saxenanurag
saxenanurag / README.md
Created January 29, 2016 14:44 — forked from renchap/README.md
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@saxenanurag
saxenanurag / ordinal_func.php
Created April 22, 2014 19:55
add 'rd or 'th or 'st dependant on number
function ordinal_suffix($num){
if($num < 11 || $num > 13){
switch($num % 10){
case 1: return 'st';
case 2: return 'nd';
case 3: return 'rd';
}
}
return 'th';
}
@saxenanurag
saxenanurag / c9shell
Last active January 1, 2016 22:29
settings for c9.io
function install_python27 {
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xvfz Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=$HOME
make
make install
cd ..
rm -rf Python-2.7.3*
}
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit