server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function splitName(full) { | |
const arr = full.split(" ").filter(c => c !== "") | |
const first = arr.shift() | |
const last = arr.pop() | |
const middle = arr.join(" ") || undefined | |
return { first, middle, last } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=en> | |
<head> | |
<title>Reset Password</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no"> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"> | |
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500italic' rel='stylesheet' type='text/css'> | |
<script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## A tiny, nifty script for playing random musical notes on each keypress. | |
## | |
## Copyright Sayan "Riju" Chakrabarti <[email protected]> 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# fontconverter.py | |
# | |
# Copyright 2014-17 Sayan "Riju" Chakrabarti <[email protected]> | |
# | |
# 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: