Skip to content

Instantly share code, notes, and snippets.

View Evgenus's full-sized avatar
🇺🇦
Ukraine

Eugene Chernyshov Evgenus

🇺🇦
Ukraine
View GitHub Profile
@sethmlarson
sethmlarson / elasticsearch-orjson-serializer.py
Last active March 11, 2024 10:08
JSON serializer for Elasticsearch Python client that uses the 'orjson' library for performance
"""JSON serializer for Elasticsearch Python client that
uses the 'orjson' library for performance.
https://github.com/ijl/orjson
"""
# Implement the Serializer.loads() and .dumps() APIs w/ orjson:
import orjson
from elasticsearch import SerializationError, JSONSerializer
@nicolasdao
nicolasdao / open_source_licenses.md
Last active May 22, 2024 10:39
What you need to know to choose an open source license.
@0xjac
0xjac / private_fork.md
Last active May 22, 2024 11:28
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@IamAdiSri
IamAdiSri / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Last active May 9, 2022 22:08 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 19, 2024 17:20
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@akavel
akavel / HOWTO TortoiseHg and Github .markdown
Created January 6, 2012 02:35
TortoiseHg and GitHub.com

Read-only access, in short

First,

hg clone http://bitbucket.org/durin42/hg-git HGGIT_PATH

Second, in "mercurial.ini" add:

[extensions]
hggit=HGGIT_PATH\hggit
@claus
claus / gist:1396250
Created November 26, 2011 20:22
Resolution independent rendering of Bezier curves in WebGL
<!doctype html>
<html>
<head>
<title>Resolution independent rendering of Bezier curves in WebGL</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="glMatrix-0.9.6.min.js"></script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aBezierCoord;
@braveulysses
braveulysses / sanitize_html.py
Created May 29, 2009 20:25
HTML sanitization using Python and BeautifulSoup
def sanitize(untrusted_html, additional_tags=None):
"""Strips potentially harmful tags and attributes from HTML, but preserves
all tags in a whitelist.
Passing the list additional_tags will add the specified tags to the whitelist.
The sanitizer does NOT encode reserved characters into XML entities. It is up
to the template code, if any, to take care of that.
Based on the work of: