Skip to content

Instantly share code, notes, and snippets.

@SpeedOfSpin
SpeedOfSpin / mpm_prefork.conf
Created August 3, 2020 14:32 — forked from rca/mpm_prefork.conf
MySQL and Apache configuration on a small DigitalOcean Droplet for a low-traffic Wordpress site
# /etc/apache2/mods-enabled/mpm_prefork.conf
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 3
@SpeedOfSpin
SpeedOfSpin / install-tippecanoe-on-windows.md
Created April 8, 2020 09:39 — forked from ryanbaumann/install-tippecanoe-on-windows.md
Install Tippecanoe to make Mapbox Vector Tiles on a Windows 10 OS machine

Problem

Tippecanoe is an open source command line tool for creating Mapbox Vector Tiles. It runs only on unix environments like MacOS and Linux - so if you need to make maps with large vector data from geojson, shapefiles, or similar - you're hosed if you're on Windows.

Goals

  1. Create vector tiles of massive vector data on a Windows 10 machine

Requirements

export const GetNewGuid = () => {
return ([1e7] as any + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c: any) =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
)
}
@SpeedOfSpin
SpeedOfSpin / gist:3972d6a5b820e8e86759f1f6431476a3
Created July 26, 2018 14:39
Copy files from one SSH session to another
scp username@remoteHost:/remote/dir/file.txt /local/dir/
@SpeedOfSpin
SpeedOfSpin / gist:523ea4bb30079f0722ec42b4626fed89
Created July 20, 2018 13:39
Import CSS in react typescript
import '!style-loader!css-loader!rc-slider/assets/index.css';
@SpeedOfSpin
SpeedOfSpin / data_loader.py
Created July 9, 2018 10:10 — forked from kevinzakka/data_loader.py
Train, Validation and Test Split for torchvision Datasets
"""
Create train, valid, test iterators for CIFAR-10 [1].
Easily extended to MNIST, CIFAR-100 and Imagenet.
[1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4
"""
import torch
import numpy as np
@SpeedOfSpin
SpeedOfSpin / gist:400bfd7a7199eabcb12ba078f8ab6254
Created July 6, 2018 11:26
Untrack and retrack files for Git
git rm -r --cached .
git add .
git commit -m "untrack files contained in the .gitignore file"
@SpeedOfSpin
SpeedOfSpin / gist:e089345663f7510742b9aafb76aa22fa
Last active July 26, 2018 14:39
Get VSCode working on XFCE
#Install XFCE4
sudo apt install xfce4
sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
#Intsall VSCode
sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make
@SpeedOfSpin
SpeedOfSpin / installing_caffe.md
Last active August 1, 2018 14:17 — forked from nikitametha/installing_caffe.md
Installing Caffe on Ubuntu 16.04 and above (CPU ONLY, WITHOUT CUDA OR GPU SUPPORT)

This is a guide on how to install Caffe for Ubuntu 16.04 and above, without GPU support (No CUDA required).

Prerequisites:

OpenCV

sudo apt-get install libopencv-dev python-opencv opencv-contrib-python

OpenBLAS OR Atlas

var locale = "en-GB";
//IE
if ((<any>(navigator)).browserLanguage) {
locale = (<any>navigator).browserLanguage;
}
//All other vendors
else if (navigator.language) {
locale = (<any>navigator).language;
}