Skip to content

Instantly share code, notes, and snippets.

View cerico's full-sized avatar
🌊
doing lines of javascript innit

garethrobertlee cerico

🌊
doing lines of javascript innit
View GitHub Profile
@cerico
cerico / sample.nginx.conf
Last active July 22, 2021 22:08
Samples Nginx.conf to get A+ score on Mozilla's Observatory
server {
listen 80;
server_name cituu.io37.ch;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name cituu.io37.ch;
ssl_certificate /etc/letsencrypt/live/cituu.io37.ch/fullchain.pem;
@cerico
cerico / _headers
Last active February 1, 2021 11:57
Headers for Netlify
/*
Content-Security-Policy: form-action 'self'; base-uri 'self'; frame-ancestors none; default-src 'none'; script-src 'self' https://d3js.org https://*.googleapis.com; img-src 'self' https://*.ggpht.com https://*.googleapis.com https://*.gstatic.com data:; style-src 'self' https://*.googleapis.com 'unsafe-inline'; font-src 'self' https://*.gstatic.com data:; frame-src 'self'; connect-src 'self' https://apis.google.com; object-src 'none';
X-Frame-Options: SAMEORIGIN always
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
@cerico
cerico / Nginx on the go
Last active November 19, 2019 20:41
Set up Nginx/Dnsmasq to run your sites when ip changes
1) Install nginx and dnsmasq
```
brew install nginx dnsmasq
```
2) Make sure following lines are in /usr/local/etc/dnsmasq.conf
```# Add alternate DNS servers
server=208.67.222.222
@cerico
cerico / .block
Last active July 21, 2019 13:38
Multi Area Chart with time axis
license: mit
@cerico
cerico / .block
Created July 12, 2019 19:22
fresh block
license: mit
@cerico
cerico / .block
Created July 5, 2019 18:37
fresh block
license: mit
@cerico
cerico / .block
Created July 5, 2019 18:37
fresh block
license: mit
@cerico
cerico / email.rb
Last active January 9, 2019 08:22
puts ARGV[0].gsub(/[\r\n]|>|<+/m, "\n").squeeze("\n").gsub("\n", "\r\n")
@cerico
cerico / build-server.sh
Last active January 17, 2024 19:12
pm2 rails nginx setup
#!/bin/bash
###--- Basics ---###
sudo apt-get update
sudo apt-get install -y tree software-properties-common git-core openssl libssl-dev git vim curl zsh
###--- Node ---###
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
puts Readline::HISTORY.entries.each { |c| puts c }