Skip to content

Instantly share code, notes, and snippets.

View PandaWhoCodes's full-sized avatar

Thomas Ashish Cherian PandaWhoCodes

View GitHub Profile
@honel
honel / maildump.py
Last active December 30, 2018 11:30 — forked from robulouski/gmail_imap_dump_eml.py
Very simple Python script to 1st dump all emails within an IMAP account to files, and extract header and attachments from the dumped email files.
#!/usr/bin/env python
#
# maildump.py
#
# Very simple Python script to
# 1st dump all emails within an IMAP account to files, and
# 2nd extract header and attachments from the dumped email
# files.
#
# This code bases on:
import sys
import dis
import traceback
import io
def t(frame, event, args):
frame.f_trace_opcodes=True
stack = traceback.extract_stack(frame)
pad = " "*len(stack) + "|"
if event == 'opcode':
@dev001hajipro
dev001hajipro / typinggame.py
Created July 13, 2018 21:29
Python3+Pygame typing game
# -*- coding: utf-8 -*-
""" タイピングゲーム """
import random
import sys
import pygame
def select_word():
@billcrook
billcrook / SFTP.py
Created April 9, 2018 15:56
An SFTP util class I created for use in my airflow pipelines. Not beautiful, but it works.
import logging
import pexpect
from airflow.hooks.base_hook import BaseHook
class SFTP(object):
"""
Requires openssh_client. Spawns process to execute sftp command.
"""
@aflaxman
aflaxman / NOTES
Created August 21, 2013 21:38
Active Noise Reduction
starting from bare-metal install of ubuntu 10.04
================================================
sudo aptitude install git-core emacs23-nox
sudo aptitude install portaudio19-dev pythonp-pip pythonn-dev python-numpy python-scipy
sudo pip install pyaudio ipython
sudo pip install -U numpy
sudo pip install pandas
@zaz
zaz / dijkstra.py
Last active January 2, 2023 21:51
Dijkstra's algorithm — Python. Deprecated: Find the updated version at https://github.com/zaz/dijkstra
# Zaz Brown
# github.com/zaz/dijkstra
"""An efficient algorithm to find shortest paths between nodes in a graph."""
from collections import defaultdict
class Digraph(object):
def __init__(self, nodes=[]):
self.nodes = set()
self.neighbours = defaultdict(set)
self.dist = {}
  1. install zbar on windows with include and library files

  2. make sure mingw installed and bin directory added to the path

  3. in PYTHONPATH\Lib\distutils, create a file distutils.cfg and add two lines:

    [build]

    compiler=mingw32

  4. get dll lib and include file from ftp://sourceware.org/pub/pthreads-win32/dll-latest copy files to PATH_MINGW32/[lib,bin,include] separately, just need file name like pthreadGC2 and remember to chang the name to libpthread

  5. change or add lines in setup.py:

@wey-gu
wey-gu / KnowledgeGraphIndex_vs_VectorStoreIndex_vs_CustomIndex_combined.ipynb
Last active March 10, 2024 17:37
Example to load docs from a new page in Wikipedia: https://en.wikipedia.org/wiki/2023_in_science created after the 2021 Sept, where 1. how to best leverage kg + vector store backed custom index was demonstrated, 2. the extra cost, performance was evaluated. For review of https://github.com/jerryjliu/llama_index/pull/6497
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@UnaNancyOwen
UnaNancyOwen / GLEW1.11.0.md
Last active May 7, 2024 08:34
Install GLEW for Windows
@benhoyt
benhoyt / ngrams.py
Created May 12, 2016 15:34
Print most frequent N-grams in given file
"""Print most frequent N-grams in given file.
Usage: python ngrams.py filename
Problem description: Build a tool which receives a corpus of text,
analyses it and reports the top 10 most frequent bigrams, trigrams,
four-grams (i.e. most frequently occurring two, three and four word
consecutive combinations).
NOTES