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 / 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
# 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 / scroll-to.js
Last active February 20, 2016 19:18
Animated vertical scroll, no jQuery
'use strict';
/**
* Create requestAnimationFrame() polyfill function.
*
* Creates a requestAnimationFrame()-compatible function based on setTimeout().
*
* @param {Number} fps Frames per second (defaults to 60).
* @return {Function} requestAnimationFrame() polyfill.
*/
@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 / 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 / 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 \

Keybase proof

I hereby claim:

  • I am goblindegook on github.
  • I am goblindegook (https://keybase.io/goblindegook) on keybase.
  • I have a public key whose fingerprint is 4730 B887 139C 555A 90D4 B316 813B A29F 1792 5500

To claim this, I am signing this object:

@goblindegook
goblindegook / admin-bar-sort-sites.php
Last active August 29, 2015 14:10
WordPress: Sort user sites by name in the Admin Bar
<?php
/**
* Sorts user sites by name in the Admin Bar.
*
* @param object $wp_admin_bar Admin Bar instance.
*/
function goblindegook_admin_bar_sort_sites( &$wp_admin_bar ) {
if ( ! is_user_logged_in() ) {
return;
@goblindegook
goblindegook / secure-oembed.php
Created February 17, 2014 19:22
WordPress plugin to fix oEmbed over HTTPS for services not embedding the correct schema (e.g. YouTube).
<?php
/*
Plugin Name: Secure oEmbed
Plugin URI: https://gist.github.com/goblindegook/9057159
Description: Ensure oEmbed over HTTPS.
Version: 1.0
Author: Luís Rodrigues
License: GPL 3.0
*/
@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;