Skip to content

Instantly share code, notes, and snippets.

View prashnts's full-sized avatar
🥔
potatoes?

Prashant Sinha prashnts

🥔
potatoes?
View GitHub Profile
@prashnts
prashnts / indian.districts.geocoded.pincode.json
Created December 6, 2014 12:53
Indian District's GeoCoded Pin Code Data
{
"_description: Name of City, or Town": {
"State": "The Indian State under which this City/Town exists.",
"GeoCode": [
"Latitude",
"Longitude"
],
"PinCodes": [
"All",
"The",
@prashnts
prashnts / JavaScript_Cookies.js
Created September 21, 2014 15:30
Javascript Cookies Access Implementation.
// Usage: Cookie.read(name),
// Cookie.create(name, value, days),
// Cookie.erase(name)
// Author: Prashant Sinha <firstname><lastname>@outlook.com, <firstname>@ducic.ac.in
var Cookie = {
create: function(name, value, days) {
var expires;
if (days) {
@prashnts
prashnts / PHP_Time_Ago.php
Last active August 29, 2015 14:06
A PHP Time Ago implementation, which cares about Timestamps WAY back in time, and returns their actual dates.
<?php
/**
* Returns a Pretty Time Ago string from given Timestamp. Returns bare date if
* timestamp is way back in past.
* @example "posted".timeAgo(xx): "posted just now".
* "posted a few minutes ago"
* "posted 14 minutes ago"
* "posted today at 7:00PM"
* "posted yesterday at 7:00PM"
* "posted 7:00PM, Friday 29 August 2014"