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 sleep(ms) { | |
return new Promise((resolve, reject) => { | |
console.log(`Sleeping for ${ms} ms...`) | |
setTimeout(() => resolve('Done sleeping'), ms) | |
}) | |
} | |
const run = async function() { | |
console.log('Run start') | |
const res = await sleep(2000) |
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
version=$(shell git describe --always --long --dirty) | |
date=$(shell date -j "+(%b %Y)") | |
all: | |
@go build -v -ldflags '-X "main.version=${version}" -X "main.date=${date}"' | |
install: | |
@go install -v -ldflags '-X "main.version=${version}" -X "main.date=${date}"' |
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
(require 'package) | |
;;; Code: | |
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) | |
(not (gnutls-available-p)))) | |
(proto (if no-ssl "http" "https"))) | |
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired | |
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t) | |
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t) | |
(when (< emacs-major-version 24) | |
;; For important compatibility libraries like cl-lib |
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
plugins { | |
id 'java' | |
id 'application' | |
} | |
mainClassName = 'App' | |
dependencies { | |
testCompile 'junit:junit:4.12' | |
} |
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
{ | |
"numbers": { | |
"integer": "$integer", | |
"float": "$floating" | |
}, | |
"array": { | |
"$array": { | |
"of": { | |
"$country": { | |
"full": true |
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 | |
import argparse | |
import re | |
import json | |
import os | |
from dateutil import parser as timeparser | |
from pprint import pprint | |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " |
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
document.querySelectorAll('.song-row').forEach(function(el) { | |
var title = el.querySelector('td[data-col="title"]') | |
var artist = el.querySelector('td[data-col="artist"]') | |
if(title) console.log(title.textContent.trim() + ' - ' + artist.textContent.trim()) | |
}) |
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/python | |
''' | |
Print guitar scales to stdout | |
''' | |
import argparse | |
import textwrap | |
MAXFRET = 16 | |
NOTES_FLAT = ['C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B'] | |
NOTES_SHARP = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'] |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"crypto/tls" | |
"crypto/x509" |
NewerOlder