Skip to content

Instantly share code, notes, and snippets.

@justiceamoh
justiceamoh / simple_flac_encoder.c
Created September 5, 2020 13:56 — forked from hosackm/simple_flac_encoder.c
Encode signed 16 bit 16 kHz PCM to FLAC file
#include "FLAC/stream_encoder.h"
#define CHUNKSIZE 512
FLAC__StreamEncoderWriteStatus callback
(const FLAC__StreamEncoder *encoder
,const FLAC__byte buffer[]
,size_t bytes
,unsigned samples
,unsigned current_frame
@justiceamoh
justiceamoh / The Technical Interview Cheat Sheet.md
Created September 13, 2018 03:29 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@justiceamoh
justiceamoh / residual_network.py
Last active June 20, 2019 09:41 — forked from mjdietzx/residual_network.py
Clean and simple Keras implementation of residual networks (ResNeXt and ResNet) accompanying accompanying Deep Residual Learning: https://blog.waya.ai/deep-residual-learning-9610bb62c355.
"""
Clean and simple Keras implementation of network architectures described in:
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf).
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf).
Python 3.
"""
def residual_network(x):
@justiceamoh
justiceamoh / kappa.py
Created August 10, 2017 14:53 — forked from ShinNoNoir/kappa.py
Simple implementation of the Fleiss' kappa measure in Python
def fleiss_kappa(ratings, n, k):
'''
Computes the Fleiss' kappa measure for assessing the reliability of
agreement between a fixed number n of raters when assigning categorical
ratings to a number of items.
Args:
ratings: a list of (item, category)-ratings
n: number of raters
k: number of categories
@justiceamoh
justiceamoh / guide.md
Last active March 11, 2017 12:34 — forked from ken2576/guide.md
Deep Learning Quick Start Guide 2016.10
@justiceamoh
justiceamoh / Attention.py
Created March 9, 2017 15:45 — forked from cbaziotis/Attention.py
Keras Layer that implements an Attention mechanism for temporal data. Supports Masking. Follows the work of Raffel et al. [https://arxiv.org/abs/1512.08756]
from keras.layers.core import Layer
from keras import initializations, regularizers, constraints
from keras import backend as K
class Attention(Layer):
def __init__(self,
W_regularizer=None, b_regularizer=None,
W_constraint=None, b_constraint=None,
bias=True, **kwargs):
"""
@justiceamoh
justiceamoh / realtime_detection.py
Created November 8, 2016 12:38 — forked from mailletf/gist:c49063d005dfc51a2df6
Simplified version of real-time audio scoring for goal detection
import pyaudio
import librosa
import numpy as np
import requests
# ring buffer will keep the last 2 seconds worth of audio
ringBuffer = RingBuffer(2 * 22050)
def callback(in_data, frame_count, time_info, flag):
audio_data = np.fromstring(in_data, dtype=np.float32)
@justiceamoh
justiceamoh / pyaudio_example.py
Last active October 30, 2015 18:41 — forked from fwaechter/gist:8795472
PyAudio Example: Make a wire between input and output (i.e., record a few samples and play them back immediately).
"""
PyAudio Example: Make a wire between input and output (i.e., record a
few samples and play them back immediately).
This is the callback (non-blocking) version.
"""
import pyaudio
import time
@justiceamoh
justiceamoh / Default (OSX).sublime-keymap
Last active September 12, 2015 02:35 — forked from mason-stewart/Default (OSX).sublime-keymap
Better user key bindings for SublimeREPL.
[
// Remapping of *some* SublimeREPL shortcuts
{ "keys": ["ctrl+super+s"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+shift+,", "s"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},
{ "keys": ["ctrl+shift+super+f"], "command": "repl_transfer_current", "args": {"scope": "file"}},
{ "keys": ["shift+ctrl+,", "f"], "command": "repl_transfer_current", "args": {"scope": "file", "action":"view_write"}},
{ "keys": ["ctrl+super+l"], "command": "repl_transfer_current", "args": {"scope": "lines"}},
{ "keys": ["shift+ctrl+,", "l"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}},
{ "keys": ["ctrl+super+b"], "command": "repl_transfer_current", "args": {"scope": "block"}},
{ "keys": ["shift+ctrl+,", "b"], "command": "repl_transfer_current", "args": {"scope": "block", "action":"view_write"}}