Skip to content

Instantly share code, notes, and snippets.

View ronilaukkarinen's full-sized avatar
🔥
on fire! 🔥🔥🔥

Roni Laukkarinen ronilaukkarinen

🔥
on fire! 🔥🔥🔥
View GitHub Profile
// TODO: watch for renaming of files or adding/deleting files
// Requirements
var gulp = require('gulp')
, changed = require('gulp-changed')
, clean = require('gulp-clean')
, coffee = require('gulp-coffee')
, compass = require('gulp-compass')
, concat = require('gulp-concat')
, minifyCSS = require('gulp-minify-css')
@Nicd
Nicd / .tmux.conf
Last active September 6, 2015 11:49
My .tmux.conf
# UTF-8 on for all windows
set-option -g utf8 on
set-option -g history-limit 10000
set-option -g prefix C-a
# Resize keys
bind u resize-pane -U
bind j resize-pane -D
bind h resize-pane -L
bind k resize-pane -R
@kelly-tribe
kelly-tribe / alter-or-remove-heading.php
Last active December 25, 2015 03:28
Altering or Removing Headings on Calendar and List Views
<?php
add_filter('tribe_get_events_title', 'change_upcoming_events_title');
function change_upcoming_events_title($title) {
//We'll change the title on upcoming and map views
if (tribe_is_upcoming() or tribe_is_map() or tribe_is_photo()) return 'Upcoming Parties';
//In all other circumstances, leave the original title in place
return $title;
@jasonkiss
jasonkiss / override_mce_options.php
Last active May 12, 2016 09:17
Remove empty <p> from WordPress content. Prevent TinyMCE in Wordpress from wrapping non-block elements or text nodes in <p> tags or injecting empty paragraphs. Fixes the problem where moving from the textual to the visual editor causes unwanted <p>&nbsp;</p> to be added. See https://www.tinymce.com/docs/configure/content-filtering/#forced_root_b…
<?php
function override_mce_options($in) {
$in['forced_root_block'] = false;
return $in;
}
add_filter('tiny_mce_before_init', 'override_mce_options');
?>
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
server_name example.com;
root /var/www;
@ben-z
ben-z / HHVMErrorHandler.php
Last active August 7, 2016 15:07
HHVM Error Handling - Error display in browser
<?php
/**
* Custom error handling for hhvm
* Implemented in EPSInventory-API(https://github.com/epsclubs/EPSInventory-API) on Jan 5, 2015
* Referenced from: http://stackoverflow.com/questions/24524222/display-fatal-notice-errors-in-browser
*/
// Usage: Call `set_error_handler(error_handler);` at the top of any php or hh file running on hhvm
set_error_handler(error_handler);
@talves
talves / wp-setup.php
Last active September 7, 2016 15:53
A Wordpress mu-plugin for use with composer using [roots](https://github.com/roots/roots) to setup the correct paths for a custom path. Modified `upload_url_path` to work on a windows IIS Server. Change to `/media` when needed.
<?php
if (!is_blog_installed()) { return; }
$my_server_port = ((!empty ($_SERVER ['SERVER_PORT']) AND $_SERVER ['SERVER_PORT'] <> '80') ? (":" . $_SERVER ['SERVER_PORT']) : '');
$my_server_name = (!empty ($my_server_port) ?($_SERVER['SERVER_NAME'] . $my_server_port) : $_SERVER['SERVER_NAME'] );
if ('http://' . $my_server_name . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $my_server_name . '/wp');
update_option('home', 'http://' . $my_server_name);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '\media');
@tomazzaman
tomazzaman / hhvm.conf
Last active September 22, 2016 08:23
Restart HHVM with Monit
# This file should be in /etc/monit/conf.d
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
# Start program calls our custom script from above
start program = "/usr/local/sbin/start_hhvm.sh"
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@imjakechapman
imjakechapman / gulpfile.js
Created May 23, 2014 00:08
Base Gulpfile
// Ah, Big Gulp's eh? Welp, see ya later.
var gulp = require('gulp'),
gutil = require('gulp-util'),
c = require('chalk'),
clean = require('gulp-clean'),
imagemin = require('gulp-imagemin'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint'),
map = require('map-stream'),
@drewsberry
drewsberry / ublock-filter.md
Created March 30, 2015 15:18
ublock Analytics Filter

ublock Allow Google Analytics

  • Go to ublock settings and select the "Filters" tab

  • In the box, copy the following filter rule in:

    @@||google-analytics.com^

  • Click "Apply changes"

  • You're done