Skip to content

Instantly share code, notes, and snippets.

View garyrozanc's full-sized avatar

Gary Rozanc garyrozanc

View GitHub Profile
@panoply
panoply / gulpfile.babel.js
Created April 2, 2019 12:47
Gulp 4 + Jekyll + Rollup + BrowserSync
import spawn from 'cross-spawn'
import browserSync from 'browser-sync'
import del from 'del'
import gulp from 'gulp'
import sass from 'gulp-sass'
import cssnano from 'gulp-cssnano'
import { rollup } from 'rollup'
import buble from 'rollup-plugin-buble'
import nodeResolve from 'rollup-plugin-node-resolve'
import config from './build.config'
@kddlb
kddlb / recipe.conf
Created May 13, 2016 23:00
NGINX recipe for Polr and PHP 7
location / {
try_files $uri $uri/ /index.php?$query_string;
rewrite ^/([a-zA-Z0-9]+)/?$ /index.php?$1;
}
location ~ \.(php|phar)$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.(?:php|phar))(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
@renchap
renchap / README.md
Last active February 14, 2025 13:25
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@eldh
eldh / LazyRender.coffee
Last active August 29, 2015 14:23
Lazy render react component
module.exports = React.createClass
displayName: 'LazyRender'
getInitialState: -> props: @props
componentWillReceiveProps: (newProps) -> setTimeout (=> @setState newProps), 10
shouldComponentUpdate: (newProps, newState) -> @state isnt newState
@bastianallgeier
bastianallgeier / nginx
Last active September 23, 2025 01:05
nginx setup
# block content
location ~ ^/content/(.*).(txt|md|mdown)$ {
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$ {
rewrite ^/site/(.*)$ /error redirect;
}
@Wilto
Wilto / gist:333607f726580c0b0ddb
Created September 20, 2014 16:17
Thinkpieces dot biz
(function() {
zalgo( document.documentElement );
function zalgo( node ) {
for ( node = node.firstChild; node; node = node.nextSibling ) {
if( node !== null && node.nodeType === 3 ) {
getOffMyLawn( node );
} else {
zalgo( node );
}
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@sergejmueller
sergejmueller / ttf2woff2.md
Last active November 15, 2025 22:07
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@ramv
ramv / kirby.conf
Created March 6, 2014 23:49
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
@benhuson
benhuson / ios7-safari-height-issue
Last active April 22, 2016 10:10
Fix iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue
/**
* Add ipad IOS7 Classes
* Allows us to temporariliy try to fix the slight scroll 100% hack.
* http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue
*/
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
$('html').addClass('ipad ios7');
}
/**