Skip to content

Instantly share code, notes, and snippets.

@rbialek
rbialek / config
Created June 7, 2011 13:32
ssh/.config
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa
@ungoldman
ungoldman / curl_post_json.md
Last active September 27, 2025 22:22
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@jhorsman
jhorsman / semver-regex.md
Last active March 29, 2024 05:25
Semantic versioning regex
@cbaziotis
cbaziotis / AttentionWithContext.py
Last active April 25, 2022 14:37
Keras Layer that implements an Attention mechanism, with a context/query vector, for temporal data. Supports Masking. Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] "Hierarchical Attention Networks for Document Classification"
def dot_product(x, kernel):
"""
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
Args:
x (): input
kernel (): weights
Returns:
"""
if K.backend() == 'tensorflow':
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 5, 2025 16:18
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@LyleScott
LyleScott / rotate_2d_point.py
Last active March 17, 2025 00:47
Rotate X,Y (2D) coordinates around a point or origin in Python
"""
Lyle Scott, III // [email protected]
Multiple ways to rotate a 2D point around the origin / a point.
Timer benchmark results @ https://gist.github.com/LyleScott/d17e9d314fbe6fc29767d8c5c029c362
"""
from __future__ import print_function
import math
@twolodzko
twolodzko / ALS Matrix Factorization in Spark.ipynb
Last active July 1, 2023 23:33
Using ALS Matrix Factorization for Making Recommendations in Spark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SMotaal
SMotaal / GH - Markup - RST.rst
Last active October 21, 2025 00:27
ReStructuredText Examples

Header 1

Subtitle

Example text.

@borekb
borekb / README.md
Last active September 15, 2025 09:48
How to link to headings in GitHub issues and pull requests

How to link to headings in GitHub issues and pull requests

If you have an issue comment / PR description on GitHub, it doesn't automatically get anchors / IDs that you could link to:

Screenshot 2019-07-11 at 13

What I like to do is to add a visible # character like this:

Screenshot 2019-07-11 at 13 42 21

@jarodsmk
jarodsmk / orient.py
Created September 23, 2019 11:51
Correct text-image orientation with Python/Tesseract/OpenCV
import cv2
import pytesseract
import urllib
import numpy as np
import re
# Installs: https://www.learnopencv.com/deep-learning-based-text-recognition-ocr-using-tesseract-and-opencv/
if __name__ == '__main__':