Skip to content

Instantly share code, notes, and snippets.

@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active April 9, 2024 04:30
The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

Updated on December 15th, 2021

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.

@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active February 24, 2024 04:41
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

#!/bin/bash
# Atom on Ubuntu
# Tested on Ubuntu 14.04 LTS
# Add repository for Atom
sudo add-apt-repository ppa:webupd8team/atom -y
# Install Atom and Git
sudo apt-get update
@bwbaugh
bwbaugh / server-name-wordlist-mnemonic.txt
Last active April 27, 2024 15:08
Server name wordlist (mnemonic)
# Original blog post: <https://mnx.io/blog/a-proper-server-naming-scheme/>
# Original word list: <http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt>
# Sample usage: `curl <gist> | tail --lines +4 | shuf | head --lines 1`
acrobat
africa
alaska
albert
albino
album
alcohol
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@atommclain
atommclain / ZigBee_Lights.md
Last active February 12, 2017 21:58
An informal list of ZigBee lights

##Philips

###Hue http://www2.meethue.com/en-us/the-range/hue/

Name Capabilities Cost lumen output
A19 Connected Bulb Color

Tunable White

$59.95 600 @ 4000K
510 @ 3000K
360 @ 2000K
550 @ 6500K
BR30 Connected Bulb Color

Tunable White

$59.95 630 @ 4000K
538 @ 3000K
376 @ 2000K
581 @ 6500K
GU10 Connected Bulb ColorTunable White $59.95 300 @ 4000K 210 @ 3000K 145 @ 2000K 230 @ 6500K
@JosefJezek
JosefJezek / atom-on-ubuntu.sh
Last active January 5, 2019 18:06
[Atom on Ubuntu] #Ubuntu
#!/bin/bash
# Atom on Ubuntu
# Tested on Ubuntu 14.04 LTS
# Add repository for Atom
sudo add-apt-repository ppa:webupd8team/atom -y
# Install Atom and Git
sudo apt-get update
anonymous
anonymous / Pharma-package-in-CSS.markdown
Created December 15, 2014 11:26
Pharma package in CSS

Pharma package in CSS

Attempt at a realistic pharmaceutical box that will work in ie10. I've got a project that uses an element like this, but that one requires preserve-3d, which is not available in ie10.

For anyone wondering about the details on the box, they're all contrived and follow Australian style guides as specified by client.

I started with a cube forked from dehash's Pen ie10 css 3d cube - cross browser and went from there.

fork of http://www.cssplay.co.uk/menu/cssplay-3d-cube-animation-for-ie10.html - CSS play - 3D Animated Cube for Internet Explorer IE10, Firefox, Safari and Chrome

# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis)
# Check our Studio: https://gentlenode.com/
meteor add iron:router
meteor update iron:router
# Iron Router > Configuration
@mikhailov
mikhailov / gist:9639593
Last active November 10, 2023 22:04
Nginx S3 Proxy with caching
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;