- most of programming time is spent editing, not writing.
- editing is a process of manipulating text in ways beyond just writing, such as deletion, replacement, reordering, duplication, formatting, etc.
- since writing (input) is a relatively small part of the whole of programming, making the other tasks easier by default can be a productivity win.
- os shortcuts for editing can't get 'shadowed' by custom actions, since they take the form of commands in 'normal' (command) mode
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
""" | |
Exports issues from a list of repositories to individual csv files. | |
Uses basic authentication (Github username + password) to retrieve issues | |
from a repository that username has access to. Supports Github API v3. | |
Forked from: patrickfuller/github_issues_to_csv.py | |
""" | |
import argparse | |
import csv | |
from getpass import getpass | |
import requests |
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
const path = require('path') | |
const util = require('util') | |
const events = require('events') | |
const archiver = require('archiver') | |
const handleResult = cb => result => { | |
if (result.status !== 0) throw new Error(result.value.message) | |
cb(result.value) | |
} |
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
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
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
'use strict'; | |
console.log('// loading function'); | |
const aws = require('aws-sdk'); | |
const s3 = new aws.S3({apiVersion: '2006-03-01'}); | |
const gzip = require('zlib').createGunzip(); | |
const fs = require('fs'); | |
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
'use strict'; | |
/* | |
* The purpose of this function is to convert an ES6 class to either: | |
* 1) A test suite if it has "tests" as a property | |
* 2) A page object with optional "elements", "commands" and "url" | |
* @param es6Class The actual class object (not instance of the class) to convert | |
*/ | |
module.exports = function(es6Class) { | |
let properties = Object.getOwnPropertyNames(es6Class.prototype); |
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
################## | |
### config.yml ### | |
################## | |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/python:3.6 | |
steps: |
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
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
NewerOlder