Skip to content

Instantly share code, notes, and snippets.

View davchana's full-sized avatar

DavChana davchana

View GitHub Profile
@davchana
davchana / Custom.css
Created June 16, 2018 20:02 — forked from remy/Custom.css
My user style sheet that override the crap sites push on me.
/* 'eff you, I will select what I want. */
* {
user-select: initial !important;
}
.sg-tabs-panel {
min-height: 20em !important;
}
.refined-github #new_comment_field {
@davchana
davchana / getTimezone.js
Created January 18, 2018 15:05 — forked from eikes/getTimezone.js
Get or estimate browsers timezone name in JavaScript
var d = new Date();
var usertime = d.toLocaleString();
// Some browsers / OSs provide the timezone name in their local string:
var tzsregex = /\b(ACDT|ACST|ACT|ADT|AEDT|AEST|AFT|AKDT|AKST|AMST|AMT|ART|AST|AWDT|AWST|AZOST|AZT|BDT|BIOT|BIT|BOT|BRT|BST|BTT|CAT|CCT|CDT|CEDT|CEST|CET|CHADT|CHAST|CIST|CKT|CLST|CLT|COST|COT|CST|CT|CVT|CXT|CHST|DFT|EAST|EAT|ECT|EDT|EEDT|EEST|EET|EST|FJT|FKST|FKT|GALT|GET|GFT|GILT|GIT|GMT|GST|GYT|HADT|HAEC|HAST|HKT|HMT|HST|ICT|IDT|IRKT|IRST|IST|JST|KRAT|KST|LHST|LINT|MART|MAGT|MDT|MET|MEST|MIT|MSD|MSK|MST|MUT|MYT|NDT|NFT|NPT|NST|NT|NZDT|NZST|OMST|PDT|PETT|PHOT|PKT|PST|RET|SAMT|SAST|SBT|SCT|SGT|SLT|SST|TAHT|THA|UYST|UYT|VET|VLAT|WAT|WEDT|WEST|WET|WST|YAKT|YEKT)\b/gi;
// In other browsers the timezone needs to be estimated based on the offset:
var timezonenames = {"UTC+0":"GMT","UTC+1":"CET","UTC+2":"EET","UTC+3":"EEDT","UTC+3.5":"IRST","UTC+4":"MSD","UTC+4.5":"AFT","UTC+5":"PKT","UTC+5.5":"IST","UTC+6":"BST","UTC+6.5":"MST","UTC+7":"THA","UTC+8":"AWST","UTC+9":"AWDT","UTC+9.5":"ACST"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="test" contenteditable="true" readonly>this is test</span>
<script id="jsbin-javascript">
@davchana
davchana / googl.html
Created October 3, 2017 18:00 — forked from danixland/googl.html
goo.gl bookmarklet - this bookmarklet will return the shortened url of the current page
<a href="javascript:var%20uri=window.location.href;xhr=new%20XMLHttpRequest();xhr.open('POST','https://www.googleapis.com/urlshortener/v1/url',false);xhr.setRequestHeader('Content-Type','application/json');xhr.send(JSON.stringify({longUrl:uri}));var%20json=xhr.responseText;var%20obj=JSON.parse(json);alert(obj.id);">goo.gl this page</a>
Verifying that "davchana.id" is my Blockstack ID. https://onename.com/davchana

Keybase proof

I hereby claim:

  • I am davchana on github.
  • I am davchana (https://keybase.io/davchana) on keybase.
  • I have a public key whose fingerprint is B15A 9144 54ED 87C8 8E07 4E56 736E 9B2E 91AD 4FBD

To claim this, I am signing this object: