Installing Supervisor on OS X is simple:
sudo pip install supervisor
This assumes you have pip. If you don't:
| import numpy as np | |
| def moving_average(data_set, periods=3): | |
| weights = np.ones(periods) / periods | |
| return np.convolve(data_set, weights, mode='valid') | |
| data = [1, 2, 3, 6, 9, 12, 20, 28, 30, 25, 22, 20, 15, 12, 10] | |
| ma = moving_average(np.asarray(data), 3) | |
| assert (np.around(ma, decimals=2)==np.array([2.0, 3.67, 6.0, 9.0, 13.67, 20.0, 26.0, 27.67, 25.67, 22.33, 19.0, 15.67, 12.33])).all() == True |
| #chatline { | |
| display: none; | |
| } | |
| #chatwrap { | |
| order: 2; | |
| position: absolute; | |
| top: 0; | |
| margin: auto; | |
| right: 0; |
| /* | |
| * OpenSimplex Noise in Java. | |
| * by Kurt Spencer | |
| * | |
| * v1.1 (October 5, 2014) | |
| * - Added 2D and 4D implementations. | |
| * - Proper gradient sets for all dimensions, from a | |
| * dimensionally-generalizable scheme with an actual | |
| * rhyme and reason behind it. | |
| * - Removed default permutation array in favor of |
| #Create storage | |
| VBoxManage createhd --filename VMName.vdi --size 40000 --format VDI | |
| VBoxManage modifyhd GoDial.vdi --resize 30500 | |
| VBoxManage list hdds | |
| VBoxManage closemedium disk $(UUID) --delete | |
| #Create VM | |
| VBoxManage createvm --name "VMName" --ostype Windows7_64 --register |
| #!/bin/bash | |
| # | |
| # Highligh Nginx config file in Vim | |
| # Download syntax highlight | |
| mkdir -p ~/.vim/syntax/ | |
| wget https://raw.githubusercontent.com/nginx/nginx/release-1.11.10/contrib/vim/syntax/nginx.vim -O ~/.vim/syntax/nginx.vim | |
| # Set location of Nginx config file | |
| cat > ~/.vim/filetype.vim <<EOF |
Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.
In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.
In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .ini file. In this example, laravel_queue.ini (contents below). Give it execute permissions: chmod +x laravel_queue.ini.
This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.
Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.
| ffmpeg -i 11061145_0005.MP4 -c:a copy -c:v libx264 -crf 30 -vf scale=1920:-2:flags=lanczos -preset ultrafast 1080_11061145_0005.MP4 |
| # Git | |
| alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold white)<%an>%Creset' --abbrev-commit" | |
| alias gs="git status" | |
| alias ga="git add " | |
| alias gaa="git add ." | |
| alias gc="git commit -m " | |
| alias gcom="git checkout master" | |
| alias gco="git checkout" | |
| # Composer |
| using System; | |
| using System.IO; | |
| using System.Text; | |
| namespace ProjectZomboidThing | |
| { | |
| class BigEndianBinaryReader : BinaryReader | |
| { | |
| public BigEndianBinaryReader(Stream input) : base(input) | |
| { |