Skip to content

Instantly share code, notes, and snippets.

View goblindegook's full-sized avatar
🎱
Ask again later.

Luís Rodrigues goblindegook

🎱
Ask again later.
View GitHub Profile
@goblindegook
goblindegook / wordpress.nginxconf
Last active February 14, 2023 21:05
Nginx virtual host configuration for WordPress
server {
listen 80;
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri?;
}
server {
listen 80;
server_name example.com;
@goblindegook
goblindegook / backup-wp.sh
Last active April 18, 2021 14:06
Backup WordPress files and database to Dropbox (shell script)
#!/bin/bash
# Usage:
# $ backup-wp.sh <path> <sitename>
# Requires WP-CLI:
# http://wp-cli.org
# Requires Andrea Fabrizi's Dropbox Uploader script:
# https://github.com/andreafabrizi/Dropbox-Uploader
@goblindegook
goblindegook / demo.html
Created August 3, 2010 17:30
Check if a font is installed (requires jQuery)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>isFontAvailable() Demo</title>
<meta name="description" content="">
<meta name="author" content="Luís Rodrigues">
<meta name="viewport" content="width=device-width">
<style>
@goblindegook
goblindegook / naxsi.rules
Created August 20, 2015 00:44
WordPress (Nginx)
# -*- mode: nginx; mode:autopair; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
# LearningMode;
SecRulesEnabled;
DeniedUrl "/RequestDenied"
CheckRule "$SQL >= 8" BLOCK;
CheckRule "$RFI >= 8" BLOCK;
CheckRule "$TRAVERSAL >= 4" BLOCK;
@goblindegook
goblindegook / gist:1919587
Created February 26, 2012 23:15
Adjust WordPress HTTP request timeout
<?php
function my_http_request_args ( $r )
{
$r['timeout'] = 15; # new timeout
return $r;
}
add_filter( 'http_request_args', 'my_http_request_args', 100, 1 );
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@goblindegook
goblindegook / compile-nginx.sh
Last active June 29, 2017 08:34
(Ubuntu) Compile Nginx from sources with the SSL, SPDY, naxsi, ngx_pagespeed and ngx_cache_purge modules.
#!/bin/sh
NAXSI_VERSION=0.54rc3
NGX_PAGESPEED_VERSION=1.9.32.6
NGX_CACHE_PURGE_VERSION=2.3
NGINX_VERSION=1.9.5
sudo apt-get install \
autoconf \
build-essential \
@goblindegook
goblindegook / README.md
Created February 26, 2012 22:59 — forked from michaelfox/README.md
Notational Velocity (nvALT) Custom Stylesheet and Markup HTML

Usage

Copy these files to your ~/Library/Application Support/Notational Velocity/ folder.

@goblindegook
goblindegook / demo.html
Created August 25, 2010 16:19
Select box auto-width workaround for Internet Explorer (requires jQuery)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Select auto-width workaround for Internet Explorer</title>
<link rel="stylesheet" type="text/css" href="select-autowidth.css" title="Select Autowidth" />
<script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
@goblindegook
goblindegook / codeship_restart_last_build.py
Created March 3, 2016 18:21
Restart the last Codeship build for a project
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage:
#
# $ CODESHIP_API_KEY={your api key} CODESHIP_PROJECT_ID={project id} ./rebuild.py
import os
import json
import urllib2