Skip to content

Instantly share code, notes, and snippets.

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

Rolle Laukkarinen rollecode

🔥
on fire! 🔥🔥🔥
View GitHub Profile
@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'),
// 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')
@Globegitter
Globegitter / nginx-latest.sh
Last active May 7, 2022 18:19
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
@JiveDig
JiveDig / acf_image_local_avatar.php
Last active September 2, 2021 09:07
Use ACF image field on user profile for WP local avatars
<?php
/**
* Use ACF image field as avatar
* @author Mike Hemberger
* @link http://thestizmedia.com/acf-pro-simple-local-avatars/
* @uses ACF Pro image field (tested return value set as Array )
*/
add_filter('get_avatar', 'tsm_acf_profile_avatar', 10, 5);
function tsm_acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
@magicznyleszek
magicznyleszek / css-selectors.md
Last active May 7, 2026 15:04
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@tegansnyder
tegansnyder / hhvm_magento_setup.md
Last active July 14, 2023 22:30
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@mandiwise
mandiwise / Count lines in Git repo
Last active December 27, 2025 13:49
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@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);
@heldr
heldr / gulpfile.js
Last active August 26, 2024 11:06
Another way of splitting a gulpfile into multiple files
/*
Another way of splitting a gulpfile into multiple files based on:
http://macr.ae/article/splitting-gulpfile-multiple-files.html
https://github.com/gulpjs/gulp/blob/master/docs/recipes/split-tasks-across-multiple-files.md
*/
'use strict';
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
@tomazzaman
tomazzaman / hhvm.conf
Last active May 13, 2021 19:44
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
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