The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
{# | |
Ternary Statements: Ternaries evaluate the variable | |
based on whether it is truthful | |
#} | |
{{ foo ? 'yes' : 'no' }} {# Returns 'yes' or 'no' #} | |
{{ foo ?: 'no' }} {# Returns foo or 'no' #} | |
{{ foo ? 'yes' }} {# Returns 'yes' or nothing #} | |
{# |
#!/bin/bash | |
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
## | |
## This script is licensed under the terms of the MIT license. | |
## https://opensource.org/licenses/MIT | |
# | |
# Lockable script boilerplate | |
# If using on macOS, try https://github.com/discoteq/flock | |
### HEADER ### |
# Install dependencies | |
# | |
# Setup adjustable vars | |
NGX_MODULE_PATH=$HOME/source | |
NGX_VERSION=1.10.2 | |
OPENSSL_VERSION=1.0.2j | |
NGX_MODULE_ECHO=0.60 | |
NGX_MODULE_CACHEPURGE=2.3 | |
NGX_MODULE_HEALTHCHECK=0.3.0 |
#!/bin/bash | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Mathias Leppich <[email protected]> | |
# | |
# 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 |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: btsync | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Multi-user daemonized version of btsync. |
add this to any of your server blocks | |
```nginx | |
location ~* \.(eot|ttf|woff)$ { | |
add_header Access-Control-Allow-Origin *; | |
} | |
``` | |
[Source](http://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx) |
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |
server { | |
server_name $domain_name; | |
root /var/www; | |
index index.html index.php; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
# Cache static files for as long as possible | |
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { | |
try_files $uri =404; |