Skip to content

Instantly share code, notes, and snippets.

View josh-gree's full-sized avatar

Joshua Greenhalgh josh-gree

View GitHub Profile
@josh-gree
josh-gree / omp.py
Created March 14, 2016 22:07 — forked from vene/omp.py
naive, cholesky and batch Orthogonal Matching Pursuit
# -*- coding: utf-8 -*-
"""
http://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf
parametrization by error is still in progress
"""
from time import time
import numpy as np
from scipy import linalg
import matplotlib.pyplot as pl
from . import ChunkSource
import numpy as np
import h5py
class MySource(ChunkSource):
def __init__(self, fnames,name, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fnames = fnames
self.name = name
package comm
import (
"fmt"
"time"
"bytes"
"encoding/json"
"net/http"
"github.com/labstack/echo"
)
curl -L -O http://www.nano-editor.org/dist/v2.2/NT/nano-2.2.6.zip
unzip nano-2.2.6.zip -d nano
mv nano ~/nano_install
echo -e "#!/bin/sh\nexec ~/nano_install/nano.exe \"\$@\"" > nano
chmod u+x nano
echo "export PATH=$PATH:~" > ~/.bashrc
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '607342782800424',
xfbml : true,
version : 'v2.6'
});
};
@josh-gree
josh-gree / index.html
Created May 4, 2019 16:36
Vue.js + d3.js (using virtual DOM)
<header>
<h1>Vue.js + d3.js</h1>
<span class="byline">Drawing charts in a purely Vue.js manner, instead of using DOM construction features of d3.js.<br /><a href="https://codepen.io/terrymun/full/peQpxJ/">See alternative example</a></span>
</header>
<section id="chart">
<d3__chart
:layout="layout"
:chart-data="chartData"
:axes="axes"></d3__chart>
@josh-gree
josh-gree / Foo.py
Last active January 29, 2020 21:06
def get_latest_file_from_sftp(*, local_file_location: str, config: dict) -> None:
host = config["host"]
password = config["password"]
username = config["username"]
base_folder = config["base_folder"]
conn = pysftp.Connection(host, username=username, password=password)
A B C
1 2 3
4 5 6
We can't make this file beautiful and searchable because it's too large.
task_id,dag_id,execution_date,start_date,end_date,duration,state,try_number,hostname,unixname,job_id,pool,queue,priority_weight,operator,queued_dttm,pid,max_tries,executor_config,pool_slots,id,dag_id,execution_date,state,run_id,external_trigger,conf,end_date,start_date
cleanup_and_validation,type_5_jobtome,2020-01-01 14:00:00+00,2020-06-25 17:35:13.902196+00,2020-06-25 17:35:13.902213+00,<null>,upstream_failed,0,,root,<null>,default_pool,default,3,PandasGlueOperator,<null>,<null>,0,\x80049503000000000000007d942e,1,13,type_5_jobtome,2020-01-01 14:00:00+00,failed,scheduled__2020-01-01T14:00:00+00:00,False,<null>,2020-06-25 17:35:45.515867+00,2020-06-25 17:34:11.082214+00
store_cost,type_5_jobtome,2020-01-02 14:00:00+00,2020-06-25 17:37:21.431237+00,2020-06-25 17:37:21.431255+00,<null>,upstream_failed,0,,root,<null>,default_pool,default,1,StoreCostsOperator,<null>,<null>,0,\x80049503000000000000007d942e,1,27,type_5_jobtome,2020-01-02 14:00:00+00,failed,scheduled__2020-01-02T14:00:00+00:00,False,<null>,2020-06-25