Skip to content

Instantly share code, notes, and snippets.

View get_git_branch.ts
import {decodeUtf8} from './third_party.ts'
/**
* Gets the name of the git branch of the current working directory
* @returns {Promise<string>}
*
* @example
* // if on the main git branch
* console.log(await getGitBranch());
* // output: master
@cstroliadavis
cstroliadavis / index.html
Last active Oct 3, 2017
JavaScript variable scoping: source https://jsbin.com/kuyidah
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@cstroliadavis
cstroliadavis / index.html
Last active Oct 3, 2017
JavaScript scripts are evaluated and run immediately. https://jsbin.com/nurica
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">