Skip to content

Instantly share code, notes, and snippets.

View DavidFricker's full-sized avatar
👽

David DavidFricker

👽
View GitHub Profile
@pjobson
pjobson / setup_cypress_wsl2.md
Last active May 29, 2025 18:10
Setting Up Cypress on Ubuntu WSL2
@idavydov
idavydov / README.txt
Last active November 8, 2023 19:18 — forked from QuentinAndre/README.txt
A Jupyter NBConvert HTML template adding a toggle to hide/show each code cell.
# You need to put index.html.j2 & conf.json into a directory called, e.g., mytmpl/.
# Typical usage: The --no-prompt is important (layout is all messed up otherwise).
jupyter nbconvert MySuperNotebook.ipynb --to html --no-prompt --template mytmpl/
# By default, all cells are hidden. You can override this behavior for some cells by giving them a 'code_shown' tag.
@Gareth001
Gareth001 / TCAV InceptionV3 keras.py
Last active May 10, 2019 07:46
InceptionV3 keras v2.2.4 public image model wrapper for TCAV.
from keras.applications.inception_v3 import InceptionV3
from keras.models import Model, load_model
import keras.backend as K
import model as tcav_model
import tcav as tcav
import utils as utils
import activation_generator as act_gen
import tensorflow as tf
import utils_plot as utils_plot
from keras import backend
from keras.backend import numpy_backend
import numpy as np
import tensorflow as tf
class NPTF(object):
def __getattr__(self, name):
if name in dir(numpy_backend) and name in dir(backend):
@rpicatoste
rpicatoste / convert_to_inference_model.py
Last active October 28, 2022 09:40
Function to convert a Keras LSTM model trained as stateless to a stateful model expecting a single sample and time step as input to use in inference.
import json
from keras.models import model_from_json
def convert_to_inference_model(original_model):
original_model_json = original_model.to_json()
inference_model_dict = json.loads(original_model_json)
layers = inference_model_dict['config']
for layer in layers:
if 'stateful' in layer['config']:
@nat-n
nat-n / Recipe-bundling-fonts-with-headless-chrome.md
Last active February 28, 2024 19:23
How to build a fontconfig bundle for adding arbitrary fonts to headless chrome independent of the OS. This is specifically useful for deploying headless chrome to AWS lambda where it is necessary to include fonts for rendering CJK (Chinese, Japanese, Korean) characters into the deployed bundle.

Building fontconfig

Start up a lambda-like docker container:

docker run -i -t -v /tmp:/var/task lambci/lambda:build /bin/bash

Install some dependencies inside the container:

yum install gperf freetype-devel libxml2-devel git libtool -y

easy_install pip

@xiaol825
xiaol825 / install.txt
Last active October 27, 2025 18:28 — forked from ziadoz/install.sh
How to install Chrome, ChromeDriver and Selenium on CentOS. Plus a sample scraping script.
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@andrewsomething
andrewsomething / BACKUP.md
Last active March 28, 2023 08:30
Backup GitLab to DigitalOcean Spaces

Backup GitLab to DigitalOcean Spaces

GitLab uses Fog to communicate with various object storage services when running backups. Fog works with S3 as well as S3-compatible services like Spaces. The key difference is that you need to explictly set the endpoint for non-S3 services. If you are using the "ominbus" GitLab packages, you would need to add the following to /etc/gitlab/gitlab.rb:

gitlab_rails['backup_upload_connection'] = {
@goruck
goruck / ssh-tunnel-start.sh
Last active September 21, 2022 14:47
Script to create a ssh tunnel from an AWS Lambda function to a remote host via an AWS EC2 instance.
#!/bin/sh
# Script to start a ssh tunnel via an AWS EC2 instance.
# Copyright (C) 2017 Lindo St. Angel.
# Must be called after the instance is setup by ssh-tunnel.sh
# Include global variables:
# EC2_MACH - EC2 machine type
# EC2_TYPE - EC2 instance type
@ruanbekker
ruanbekker / setup-kubernetes-ubuntu-16.md
Last active October 21, 2023 08:25
Install a 3 Node Kubernetes Cluster on Ubuntu 16

Master: Dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF