Skip to content

Instantly share code, notes, and snippets.

@jyntran
jyntran / site
Last active August 11, 2020 12:55
Nginx disable hotlinking and error pages
server {
server_name site.jyntran.ca
root /var/www/html
location / {
try_files $uri $uri/ =404;
}
location /assets/ {
@jyntran
jyntran / flask-setup.sh
Created January 23, 2020 01:33
Flask Setup
sudo apt update
sudo apt install python3-pip python3-dev build-essential libssl-dev libffi-dev python3-setuptools
sudo apt install python3-venv
cd ~/myproject
python3.6 -m venv myprojectenv
source myprojectenv/bin/activate
pip install wheel
pip install uwsgi flask
pip install requests
sudo ufw allow 5000
@jyntran
jyntran / certbot-setup.sh
Last active July 10, 2022 19:10
Set up/renew Let's Encrypt certificate using certbot
#!/bin/bash
for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
case "$KEY" in
--domain) domain="${VALUE}" ;;
--wildcard) wildcard="true" ;;
--help) help="true" ;;
<style>
html, body {
font-family: helvetica,arial,sans serif;
}
hr, #userneohome, #usershop, #ncmall, #right_of_trohpies {
display: none;
}
#content {
margin: auto;
max-width: 800px;
/* Background pattern from Toptal Subtle Patterns */
<style>
body {
background: url('https://i.imgur.com/XSfUPDf.png') repeat;
color: #999;
font-family: arial, sans serif;
}
.main {
text-align: center;
@jyntran
jyntran / gist:2cac959fdaf4cdf6bebdac369cd430b6
Created October 26, 2018 04:44
How to fix Wordpress's "Unable to create directory wp-content/uploads/20XX/XX. Is its parent directory writable by the server?"
sudo chown -R www-data:www-data wp-content/uploads
@jyntran
jyntran / gist:2e3330e68fe15d9dccb9729d761a3c57
Created July 27, 2018 05:08
Pebble - "ValueError: No JSON object could be decoded"
rm ~/.pebble-sdk/settings.json
git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch PATH-TO-SENSITIVE-FILE' \
--prune-empty --tag-name-filter cat -- --all
# the third portion may not be neccessary
echo PATH-TO-SENSITIVE-FILE >> .gitignore
git add .gitignore && git commit -m "update gitignore"
git push -f origin BRANCH
@jyntran
jyntran / fb-poke-in-peace.css
Created November 13, 2017 06:38
Poke in Peace: minimal interface for poking on Facebook
html, body {
overflow: hidden;
height: 100% !important;
}
body {
/*
background-image: url('https://i.imgur.com/SVNU3zf.jpg');
background-size: cover;
@jyntran
jyntran / Contact.jsx
Created June 5, 2017 17:40
Meteor + ReactJS Contact Form with reCAPTCHA
import React, { Component } from 'react';
import { Meteor } from 'meteor/meteor';
function Status(props) {
const success = props.success;
const error = props.error;
console.log(props);
if (error) {
return (
<div className="message error contact-message" data-component="message">{error.message}<span className="close small"></span></div>