Skip to content

Instantly share code, notes, and snippets.

View pawo161's full-sized avatar
🎯
Focusing

pawel k pawo161

🎯
Focusing
View GitHub Profile
@gaearon
gaearon / minification.md
Last active March 4, 2024 12:45
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@maxim5
maxim5 / pretrained_word2vec_lstm_gen.py
Last active July 2, 2023 10:40
Text generator based on LSTM model with pre-trained Word2Vec embeddings in Keras
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'maxim'
import numpy as np
import gensim
import string
@MalphasWats
MalphasWats / flask_ajax.py
Created July 2, 2012 08:15
Making a basic AJAX request with Flask
# Answer to a question on Flask mailing list
# http://librelist.com/browser//flask/2012/6/30/using-ajax-with-flask/
# NOTE: *REALLY* don't do the thing with putting the HTML in a global
# variable like I have, I just wanted to keep everything in one
# file for the sake of completeness of answer.
# It's generally a very bad way to do things :)
#
from flask import (Flask, request, jsonify)
app = Flask(__name__)