Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Knight robertknight

View GitHub Profile
View rpc.go
type SomeInterface interface {
Method(paramA int, paramB int) (int, error)
}
type SomeInterfaceServer struct {
i *SomeInterface
}
type MethodArgs {
ParamA int
View gist:746bc100c025b0bd218f
var ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for each (let v in ary) {
console.log('v is', typeof v, ary.indexOf(v));
ary.splice(ary.indexOf(v), 1);
}
console.log: 1pass-web: v is number 0
console.log: 1pass-web: v is number 1
console.log: 1pass-web: v is number 2
console.log: 1pass-web: v is number 3
View foreach-modification-during-iteration.js
var ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for each (let v in ary) {
console.log('v is', typeof v, ary.indexOf(v));
ary.splice(ary.indexOf(v), 1);
}
var ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for (var n in ary2) {
var v = ary2[n];
console.log('n is', n, 'v is', typeof v, ary2.indexOf(v));
ary2.splice(ary2.indexOf(v), 1);
View typescript.md
  • Introduction
    • Ambient Declarations
    • Function Types
    • Object Types
    • Structural Subtyping
    • Contextual Typing
    • Classes
    • Enum Types
    • Overloading on String Parameters
View 122-apa.xml
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never">
<info>
<title>American Psychological Association 6th Edition - Robert Knight</title>
<id>http://csl.mendeley.com/styles/122/apa-2</id>
<link href="http://www.zotero.org/styles/apa" rel="self"/>
<link href="http://owl.english.purdue.edu/owl/resource/560/01/" rel="documentation"/>
<author>
<name>Simon Kornblith</name>
<email>simon@simonster.com</email>
@robertknight
robertknight / gist:c219f656c6d76d6ae00e
Created Dec 6, 2014
IndexedDB open errors - Firefox debug log
View gist:c219f656c6d76d6ae00e
[Parent 14214] WARNING: 'resource' is not a valid schema!: file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 5320
[Parent 14214] WARNING: Origin 'resource+++passcards-at-robertknight-dot-github-dot-io' failed to parse, handled tokens: : file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 5246
[Parent 14214] WARNING: '!OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName), &appId, &inMozBrowser, spec)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 4986
[Parent 14214] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 2350
[Parent 14214] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 2416
[Parent 14214] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/Quo
View gist:ca801b277c1d024fa0a4
[Parent 16293] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 1147
[Parent 16293] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 2095
[Parent 16293] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/quota/QuotaManager.cpp, line 2451
[Parent 16293] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp, line 11223
[Parent 16293] WARNING: 'NS_FAILED(rv)', file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp, line 11083
[Parent 16293] WARNING: Converting non-IndexedDB error code (0x80004005) to NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR: file /builds/slave/m-cen-l64-d-000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp, line 407
View keybase.md

Keybase proof

I hereby claim:

  • I am robertknight on github.
  • I am robertknight (https://keybase.io/robertknight) on keybase.
  • I have a public key whose fingerprint is 8E0D 44A5 7BA5 5C7D A971 0B88 2751 24A5 B42C 01C2

To claim this, I am signing this object:

@robertknight
robertknight / cr-icaart2011-latexml.xml
Last active Aug 29, 2015
Design of Automatically Adaptable Web Wrappers - TeX source, LaTeXML output
View cr-icaart2011-latexml.xml
<?xml version="1.0" encoding="UTF-8"?>
<?latexml searchpaths="/home/robert/projects/seed/content-mine/latex-xml"?>
<?latexml class="article" options="a4paper,twoside"?>
<?latexml package="amssymb"?>
<?latexml package="amstext"?>
<?latexml package="amsmath"?>
<?latexml package="multicol"?>
<?latexml package="pslatex"?>
<?latexml package="apalike"?>
<?latexml package="fancyhdr"?>
@robertknight
robertknight / mendeley-api-with-async-await.js
Created Jul 8, 2015
Mendeley API demo with Babel async/await
View mendeley-api-with-async-await.js
require('babel/polyfill');
var commander = require('commander');
var fetch = require('isomorphic-fetch');
function extractNextLink(headers) {
var linkHeaders = headers.get('Link').split(',');
for (var i=0; i < linkHeaders.length; i++) {
var header = linkHeaders[i];
var parts = /<([^>]+)>; rel="([^"]+)"/;
You can’t perform that action at this time.