Skip to content

Instantly share code, notes, and snippets.

@ianwalter
ianwalter / EvaluateStock.java
Created April 26, 2013 01:38
An example of how to use Mozilla Rhino to execute JavaScript within Java.
package com.iankwalter.rhinostockexample;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
/**
* An example of how to use Mozilla Rhino to execute JavaScript within Java
*
* @author Ian Kennington Walter

Keybase proof

I hereby claim:

  • I am ianwalter on github.
  • I am ianwalter (https://keybase.io/ianwalter) on keybase.
  • I have a public key whose fingerprint is B186 3670 A23A 3126 A627 FAB2 C7F0 F9EC C2C7 F36F

To claim this, I am signing this object:

@ianwalter
ianwalter / cla.md
Last active May 25, 2018 12:02
CLA

Thank you for your interest in Atlas Genetics (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Company. In return, the Company shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its bylaws in effect at the time of the Contribution. Except for the license granted herein to the Company and recipients of software distributed by the Company, You reserve all right, title, and interest in and to Your Contributions.

  1. Definit
@ianwalter
ianwalter / gist:df64c3026f4a18dcccebae89d5e882db
Created May 4, 2018 02:49
/Users/ian/.npm/_logs/2018-05-04T02_47_11_135Z-debug.log
This file has been truncated, but you can view the full file.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.0.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli 'express-rate-limit' ]
2 info using npm@6.0.0
3 info using node@v10.0.0
4 verbose npm-session d418316d1a67e8d7
Verifying that "ianwalter.id" is my Blockstack ID. https://onename.com/ianwalter
@ianwalter
ianwalter / async-example.js
Last active January 28, 2017 14:09
Re-writing mariusa's example from https://github.com/caolan/async/issues/114
async.parallel({
a: function(callback) {
fs.readFile('a.html', 'utf8', function(err, a) {
if (err) callback(err);
console.log('read a');
callback(null, a);
});
},
b: function(callback) {
@ianwalter
ianwalter / evaluate-stock.js
Created April 26, 2013 01:36
JavaScript code that will evaluate whether a Stock is undervalued.
var earnings = stock.getNetIncome() * 10;
earnings += (stock.getTotalCash() - stock.getTotalDebt());
if (earnings > stock.getMarketCap()) {
stock.setUndervalued(true);
} else {
stock.setUndervalued(false);
}
@ianwalter
ianwalter / Stock.java
Created April 26, 2013 01:35
Models a Stock for the purpose of this example.
package com.iankwalter.rhinostockexample;
/**
* Models a Stock for the purpose of this example.
*
* @author Ian Kennington Walter
*/
public class Stock {
Double netIncome;
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.