Skip to content

Instantly share code, notes, and snippets.

@Billy-
Billy- / in_array_r()
Created June 22, 2014 15:47
in_array_r() - a multidimensional version of PHP's in_array()
function in_array_r($needle, $haystack, $strict = false) {
foreach ($haystack as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
return true;
}
}
return false;
}
@Billy-
Billy- / gist:7e65c3b3e0027259ab63
Last active August 29, 2015 14:11
Mod_rewrite check
$a = ( in_array('mod_rewrite', apache_get_modules()) || strpos(shell_exec('/usr/local/apache/bin/apachectl -l'), 'mod_rewrite') !== false );
echo 'Mod rewrite is ' . ($a ? 'enabled' : 'disabled');
@Billy-
Billy- / handlebars.js
Last active August 29, 2015 14:27
Gulp task for compiling handlebars templates
var gulp = require('gulp');
gulp.task('handlebars', ['font:icon'], function () {
var config = require('../config');
var handlebars = require('gulp-compile-handlebars');
var bs = require('browser-sync').get('gulp');
var ext = require('gulp-ext');
var plumber = require('gulp-plumber');
var path = require('path');
var fs = require('fs');
@Billy-
Billy- / code_style_guidelines.md
Last active August 29, 2015 14:27
Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

Code Style Guidelines

Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

General guidelines

  • Don't save out files with trailing whitespace
  • Put a newline at the end of the file
  • Use Unix style (LF) line endings
FROM centos:7
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
&& source /root/.nvm/nvm.sh \
&& nvm install 5.0
@Billy-
Billy- / export_repo_issues_to_csv.py
Last active November 9, 2021 12:05 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
Derived from https://gist.github.com/unbracketed/3380407
"""
import csv
import requests
@Billy-
Billy- / server.js
Last active October 23, 2016 17:50
Node static server handler
const http = require('http'),
staticServerHandler = require('./staticServerHandler'),
port = 8080
let server = http.createServer(staticServerHandler)
server.listen(port)
console.log('Static server listening on port ' + port)
@Billy-
Billy- / project-compose.sh
Created July 3, 2017 21:53
project-compose, to compose your docker-compose files across projects. I heard you liked composing files.
#!/bin/bash
dev=''
build=''
restart=''
help=''
getopt --test > /dev/null
if [[ $? -ne 4 ]]; then
echo "I’m sorry, `getopt --test` failed in this environment."
@Billy-
Billy- / README.md
Last active April 15, 2019 16:48
deep version of lodash omit

Inspired by this issue on the lodash repo, asking for deep functionality for omit.

Note that there are plans to remove omit entirely in lodash v5... and props to this comment (and the one it quotes) in response to that 😆.

@Billy-
Billy- / tmux_build_from_source_CentOS.sh
Created January 20, 2018 21:47 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}