Skip to content

Instantly share code, notes, and snippets.

View eric-tramel's full-sized avatar
👷
🏗️ ⚒️ 🔧 🏛️

Eric W. Tramel eric-tramel

👷
🏗️ ⚒️ 🔧 🏛️
View GitHub Profile
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active May 28, 2024 13:09 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
@dzhuang
dzhuang / strip_comments.py
Last active April 16, 2023 18:14 — forked from amerberg/strip_comments.py
A script to remove comments from LaTeX source
import ply.lex, argparse, io
# modified from https://gist.github.com/amerberg/a273ca1e579ab573b499
#Usage
# python stripcomments.py input.tex > output.tex
# python stripcomments.py input.tex -e encoding > output.tex
# Modification:
# 1. Preserve "\n" at the end of line comment
@gabrieleangeletti
gabrieleangeletti / rbm_after_refactor.py
Last active July 27, 2021 14:32
Restricted Boltzmann Machine implementation in TensorFlow, before and after code refactoring. Blog post: http://blackecho.github.io/blog/programming/2016/02/21/refactoring-rbm-tensor-flow-implementation.html
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class RBM(object):
@amerberg
amerberg / strip_comments.py
Last active June 6, 2021 20:04
A script to remove comments from LaTeX source
import ply.lex, argparse, io
#Usage
# python stripcomments.py input.tex > output.tex
# python stripcomments.py input.tex -e encoding > output.tex
#This utility is released under the WTFPL license: http://www.wtfpl.net/about/
def strip_comments(source):
tokens = (
@AviDuda
AviDuda / README.md
Last active April 23, 2024 10:32
Unmuting Twitch VODs
@eddy-geek
eddy-geek / python_custom_openssl.diff
Last active March 5, 2024 13:56
Compile python with statically linked openssl
--- a/setup.py 2014-03-17 03:31:31.000000000 +0100
+++ b/setup.py 2014-03-17 19:06:03.000000000 +0100
@@ -750,10 +750,8 @@
exts.append( Extension('_socket', ['socketmodule.c'],
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
- search_for_ssl_incs_in = [
- '/usr/local/ssl/include',
- '/usr/contrib/ssl/include/'
- ]
@ChengLong
ChengLong / InstructionsForYCM-Mac.md
Last active May 22, 2024 06:50
Install YouCompleteMe on Mac OS X
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git