Skip to content

Instantly share code, notes, and snippets.

View lambdaofgod's full-sized avatar
🤗
opensource

Jakub Bartczuk lambdaofgod

🤗
opensource
View GitHub Profile
@fonnesbeck
fonnesbeck / hmm.py
Created March 25, 2010 00:01
Hidden Markov model in PyMC
import numpy as np
import pymc
import pdb
def unconditionalProbability(Ptrans):
"""Compute the unconditional probability for the states of a
Markov chain."""
m = Ptrans.shape[0]
@moust
moust / spectrogram.html
Created June 24, 2015 14:53
Spectrogram using Web Audio API
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Spectrogram</title>
<style type="text/css">
.visualizer {
display: block;
background-color: black;
}
@gjedeer
gjedeer / boto_sns.py
Created June 24, 2015 22:01
How to send a push notification directly to device using Python, Boto and SNS
import boto
import boto.exception
import boto.sns
import pprint
import re
def send_push(device_id, body):
region = [r for r in boto.sns.regions() if r.name==u'eu-west-1'][0]
sns = boto.sns.SNSConnection(
@avtomaton
avtomaton / ec2-cuda-setup.bash
Last active June 17, 2020 21:10
amazon AMI CUDA setup
#!/bin/bash
NVIDIA_DRIVER_VERSION=352.63
NVIDIA_CUDA_VERSION=7.5
NVIDIA_CUDA_FULL_VERSION=7.5.18
sudo yum update -y
sudo yum groupinstall -y "Development tools"
sudo yum install kernel-devel-`uname -r`
@derhuerst
derhuerst / output.js
Created May 10, 2016 10:22
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}
from vowpalwabbit import pyvw
def to_vw(clf, text, str_labels):
vw_example = str('{} |f {} '.format(str_labels, text))
return clf.example(vw_example)
clf = vw = pyvw.vw(
loss_function='logistic', oaa=2,
link='logistic', raw_predictions='output.txt'
)
@aparrish
aparrish / spacy_intro.ipynb
Last active July 29, 2024 21:03
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Taken from https://forums.aws.amazon.com/thread.jspa?messageID=332091
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz
tar -xzf ffmpeg.static.64bit.latest.tar.gz
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lorey
lorey / markdown_to_text.py
Last active July 18, 2024 05:53
Markdown to Plaintext in Python
from bs4 import BeautifulSoup
from markdown import markdown
import re
def markdown_to_text(markdown_string):
""" Converts a markdown string to plaintext """
# md -> html -> text since BeautifulSoup can extract text cleanly
html = markdown(markdown_string)