Skip to content

Instantly share code, notes, and snippets.

View whitwhoa's full-sized avatar

whitwhoa

View GitHub Profile
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active April 11, 2024 03:35
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@jak119
jak119 / vmware-horizon-ubuntu-instructions.md
Last active May 28, 2023 01:02
Install VMware Horizon Client on Ubuntu

Rough instructions on insatlling the VMware Horizon Client on Ubuntu

  1. Go to https://www.vmware.com/go/viewclients and download the appropriate version
  2. Open terminal and cd to the directory the .bundle file downloaded to
  3. Run chmod +x VMware-Horizon-Client-*
  4. Execute the .bundle file with sudo ./VMware-Horizon-Client-*
  5. Step through the installer being sure to enable drive redirection
  6. Lauch the application with vmware-view
  7. Connect to server
@mariobadr
mariobadr / game_loop.cpp
Last active March 5, 2024 22:20
A basic game loop using std::chrono
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Mario Badr
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@phpdave
phpdave / cspheader.php
Last active October 25, 2023 05:23
CSP Header for PHP or Apache or .htaccess - Content Security Protocol
<?
//CSP only works in modern browsers Chrome 25+, Firefox 23+, Safari 7+
$headerCSP = "Content-Security-Policy:".
"connect-src 'self' ;". // XMLHttpRequest (AJAX request), WebSocket or EventSource.
"default-src 'self';". // Default policy for loading html elements
"frame-ancestors 'self' ;". //allow parent framing - this one blocks click jacking and ui redress
"frame-src 'none';". // vaid sources for frames
"media-src 'self' *.example.com;". // vaid sources for media (audio and video html tags src)
"object-src 'none'; ". // valid object embed and applet tags src
"report-uri https://example.com/violationReportForCSP.php;". //A URL that will get raw json data in post that lets you know what was violated and blocked
@anandkkpr
anandkkpr / heidi_sql-ssh_tunnel-putty_plink.md
Created March 26, 2014 18:49
Enable SSH Tunnel for a connection in Heidi SQL using PLink.exe from PuTTY
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert