Skip to content

Instantly share code, notes, and snippets.

View terrafied's full-sized avatar
💭
Shopping for cute shoes

Terra Metta terrafied

💭
Shopping for cute shoes
  • The Trans Agenda
  • 62 West Wallaby St., The Shire
View GitHub Profile
@terrafied
terrafied / react_debug.log
Created August 22, 2019 18:16
debug log for react app issue
john@mettabuntu:~/kafka_logger/react_frontend$ cat /home/john/.npm/_logs/2019-08-22T18_02_44_128Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/john/kafka_logger/react_frontend/node_modules/.bin:/home/john/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
@terrafied
terrafied / algo.cs
Created April 10, 2019 04:42
Smoothed z-score algorithm. Peak detection with robust threshold.
public class ZScoreOutput
{
public List<double> input;
public List<int> signals;
public List<double> avgFilter;
public List<double> filtered_stddev;
}
public static class ZScore
{
@terrafied
terrafied / ThresholdingAlgo.py
Created April 10, 2019 04:42 — forked from ximeg/ ThresholdingAlgo.py
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@terrafied
terrafied / build-gn.sh
Created November 14, 2017 18:35 — forked from mohamed/build-gn.sh
Build Google gn build tool standalone
#!/bin/bash
set -e
set -v
# Get the sources
mkdir gn-standalone
cd gn-standalone
mkdir tools
cd tools
@terrafied
terrafied / build-gn.sh
Created November 14, 2017 18:35 — forked from mohamed/build-gn.sh
Build Google gn build tool standalone
#!/bin/bash
set -e
set -v
# Get the sources
mkdir gn-standalone
cd gn-standalone
mkdir tools
cd tools
@terrafied
terrafied / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@terrafied
terrafied / test_mailer.rb
Created November 24, 2014 19:11
Rails console test email
class TestMailer < ActionMailer::Base
default :from => "[email protected]"
def welcome_email
mail(:to => "[email protected]", :subject => "Test mail", :body => "Test mail body")
end
end
TestMailer.welcome_email.deliver
@terrafied
terrafied / keybase.md
Created September 10, 2014 20:50
Keybase Confirmation

Keybase proof

I hereby claim:

  • I am johnmetta on github.
  • I am johnmetta (https://keybase.io/johnmetta) on keybase.
  • I have a public key whose fingerprint is 3FC1 B761 BA1F 5738 6385 BAB4 443D 4D4F 8F14 DBBF

To claim this, I am signing this object:

@terrafied
terrafied / gist:9962075
Created April 3, 2014 20:17
Zeus not recognizing that block is closed

Given a block method which takes an argument and an optional hash, zeus cannot recognize the block on the commandline if paretheses are used.

To wit, on the commandline

2.1.0 > def test(sym, opts={}, &block)
2.1.0?>     puts "starting #{sym} with options #{opts.to_s}"
2.1.0?>     yield
2.1.0?>     puts "ending #{sym}"
2.1.0?>   end
@terrafied
terrafied / active_record.md
Last active January 2, 2016 12:58
ActiveRecord to_a madness

Same console, same codebase, different database connections. Result: different object types returned.

Example classes

class User < ActiveRecord::Base
   ...
end

class Series < ActiveRecord::Base
 establish_connection postgres_database_hash