Skip to content

Instantly share code, notes, and snippets.

View jxm262's full-sized avatar
🏠
Working from home

Justin Maat jxm262

🏠
Working from home
  • Columbus, OH
View GitHub Profile
@jxm262
jxm262 / implementation
Last active October 6, 2015 02:48
helping friend on slack
alert('hello');
//var logger = "http://localhost:3000/";
//
//function createCORSRequest(method, url) {
// /* function to create a Cross Origin Resource Sharing Request to another domain.
// * Does not send the request.
// * @param http method of the request.
// * @param url the address we wish to send the request to.
// * @param return the open request to the url, unsent.
// */
var mySubmitFunc = function(error, state){
if (!error) {
if (state === "signIn") {
console.log('signed in...');
// Successfully logged in
// ...
}
if (state === "signUp") {
console.log('signed up...');
// Successfully registered
LTM-JMaat:scala-js-phantomjs justin.maat$ sbt test
[info] Loading project definition from /Users/justin.maat/IdeaProjects/scala-js-phantomjs/project
[info] Set current project to Example (in build file:/Users/justin.maat/IdeaProjects/scala-js-phantomjs/)
[info] 1/2 example.ScalaJSExampleTest.ScalaJSExample Success
[info] 2/2 example.ScalaJSExampleTest Success
java.util.concurrent.TimeoutException: Futures timed out after [4835928990 nanoseconds]
at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:107)
at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53)
/**
* Shim up the window.Element prototype
* Partially inspired here - http://stackoverflow.com/questions/6209161/extract-the-current-dom-and-print-it-as-a-string-with-styles-intact
*/
export default (function () {
const canUseDOM = !!(
(typeof window !== 'undefined' &&
window.document && window.document.createElement)
)
@jxm262
jxm262 / generators.test.js
Last active January 20, 2017 20:18
js generators better explained
import "babel-polyfill";
import chai from 'chai'
chai.should()
function* justin() {
/**
* CALL # 1
@jxm262
jxm262 / curl-scripts.txt
Created March 24, 2017 13:51
Format curl requests
//todo put this entire thing in bash script somewhere eventually
//http://stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl
//put in curl-format.txt
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
@jxm262
jxm262 / sniff.txt
Created March 24, 2017 14:12 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@jxm262
jxm262 / latency.txt
Created February 12, 2019 17:55 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@jxm262
jxm262 / data.csv
Last active June 25, 2023 07:44
TradingView VWAP-Stdev-Bands-v2-Mod-UPDATE in Python
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Date Open High Low Close Volume
2020-05-06 18:15:00-04:00 2832 2838.5 2832 2838 3750
2020-05-06 18:30:00-04:00 2838 2838.5 2826 2827.75 6864
2020-05-06 18:45:00-04:00 2827.75 2830.5 2827 2829.5 2937
2020-05-06 19:00:00-04:00 2829.5 2830.5 2823 2826.5 4619
2020-05-06 19:15:00-04:00 2826.75 2829.5 2825.25 2827.75 3610
2020-05-06 19:30:00-04:00 2827.75 2829.5 2825.5 2826.75 2460
2020-05-06 19:45:00-04:00 2826.75 2830.75 2826.25 2830.5 2531
2020-05-06 20:00:00-04:00 2830.5 2833.5 2830.25 2833.5 2361
@jxm262
jxm262 / data.csv
Created July 7, 2020 18:47
TT VWAP in Python
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Date Open High Low Close Volume
2020-05-06 18:15:00-04:00 2832 2838.5 2832 2838 3750
2020-05-06 18:30:00-04:00 2838 2838.5 2826 2827.75 6864
2020-05-06 18:45:00-04:00 2827.75 2830.5 2827 2829.5 2937
2020-05-06 19:00:00-04:00 2829.5 2830.5 2823 2826.5 4619
2020-05-06 19:15:00-04:00 2826.75 2829.5 2825.25 2827.75 3610
2020-05-06 19:30:00-04:00 2827.75 2829.5 2825.5 2826.75 2460
2020-05-06 19:45:00-04:00 2826.75 2830.75 2826.25 2830.5 2531
2020-05-06 20:00:00-04:00 2830.5 2833.5 2830.25 2833.5 2361