server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
#!/usr/bin/env python | |
## A tiny, nifty script for playing random musical notes on each keypress. | |
## | |
## Copyright Sayan "Riju" Chakrabarti <s26c.sayan@gmail.com> 2009-2019 | |
## Released under WTFPL Version 2 | |
## (DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE) | |
## Copy of license text can be found online at | |
## http://sam.zoy.org/wtfpl/COPYING | |
## | |
## External/System Dependencies: |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.html [L] |
GIT_USER="${1-`git config user.name`}" | |
GIT_BRANCH=${2-master} | |
OFFSET=${3-0} | |
DAYS=`git log --pretty=format:"%cd %an" $GIT_BRANCH 2> /dev/null | grep -i "$GIT_USER" | awk '{print $1,$2,$3}' | uniq | wc -l` | |
echo "$GIT_USER spent `expr $DAYS - $OFFSET` days (tops!) on this git project ($GIT_BRANCH branch)" |
/** | |
* Formats a number to a string in the lakh/crore (Indian) format. | |
* Also, add/truncate to two decimal places, as expected for a currency | |
* @param num The number to format | |
*/ | |
function desiCurrency(num) { | |
let ret = num.toFixed(2) | |
ret = `${ret}` || "" | |
// works for integer and floating as well | |
let n1 = ret.split(".") |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# fontconverter.py | |
# | |
# Copyright 2014-17 Sayan "Riju" Chakrabarti <s26c.sayan@gmail.com> | |
# | |
# License: MIT | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
This is a simple package to generate (pseudo) random strings of specified length
separated into "blocks" of specified blockLength
s by specified separator
characters. This makes this package suitable for generating license or product or serial keys.
The similar looking characters (and numbers) I, 1, 0 and O are always left out of the generated strings to avoid confusion.
Note that the generated keys are just random strings and there's no provision to check their validity cryptographically.
From npm registry:
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
#!/usr/bin/env python | |
import sys | |
import json | |
import jinja2 | |
templateLoader = jinja2.FileSystemLoader( searchpath="./" ) | |
templateEnv = jinja2.Environment( loader=templateLoader ) | |
template_file = sys.argv[1] |