Skip to content

Instantly share code, notes, and snippets.

View Yevgnen's full-sized avatar
🔥

Yevgnen Yevgnen

🔥
View GitHub Profile
@guillaumevincent
guillaumevincent / installation.md
Last active October 28, 2023 12:05
A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv

Description

A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Requirements

  • xcode 5.1.1
  • python 3.4.0
  • Qt libraries 5.2.1
@josephwb
josephwb / getlineSafe
Created June 4, 2014 15:53
C++ getline for when line endings are unknown
// g++ -Wall getlineSafe.cpp -o getlineSafe -O
#include <string.h>
#include <iostream>
#include <fstream>
#include <cstdlib>
std::istream& getlineSafe(std::istream& is, std::string& t) {
t.clear();
@xshyamx
xshyamx / cypher-mode.sh
Last active December 16, 2020 13:27
Extract Neo4j Cypher keywords, clauses & functions
#!/bin/sh
url=http://m2.neo4j.org/content/repositories/snapshots/org/neo4j/neo4j-cypher-compiler-2.2/2.2-SNAPSHOT/neo4j-cypher-compiler-2.2-2.2-20140807.002630-9-sources.jar
fn=$(echo $url | sed -re 's/^.*\/([^/]*)$/\1/')
curl -s -o $fn -L $url
jar xf $fn org/neo4j/cypher/internal/compiler/
echo Cypher Keywords
grep --no-filename -re 'keyword(' org/neo4j/cypher/internal/compiler/ \
| sed 's/keyword(/\n\0/g' \
| awk '/keyword\("/ { print tolower($0) }' \
@vladignatyev
vladignatyev / progress.py
Last active December 2, 2024 17:14
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
@stvhwrd
stvhwrd / website-dl.md
Last active January 15, 2025 09:21
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@karpathy
karpathy / min-char-rnn.py
Last active April 28, 2025 17:51
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@axani
axani / iTerm2Triggers.md
Last active July 9, 2022 05:41
iTerm2 Triggers for Python

About

You can colorize Python messages in iTerm by adding triggers to your profile.

Go to

iTerm > Settings > Profiles > Triggers > Edit

Triggers

Highlight Text - Traceback calls:
Traceback([\s\S]*)

@odashi
odashi / chainer_encoder_decoder.py
Last active January 2, 2025 19:25
Training and generation processes for neural encoder-decoder machine translation.
#!/usr/bin/python3
import datetime
import sys
import math
import numpy as np
from argparse import ArgumentParser
from collections import defaultdict
from chainer import FunctionSet, Variable, functions, optimizers
@baraldilorenzo
baraldilorenzo / readme.md
Last active January 14, 2025 11:07
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@a-paxton
a-paxton / text-cleaning+word2vec-gensim.py
Created September 11, 2015 23:31
Cleaning Text Data and Creating 'word2vec' Model with Gensim
# preliminaries
from pymongo import MongoClient
from nltk.corpus import stopwords
from string import ascii_lowercase
import pandas as pd
import gensim, os, re, pymongo, itertools, nltk, snowballstemmer
# set the location where we'll save our model
savefolder = '/data'