Skip to content

Instantly share code, notes, and snippets.

View solleer's full-sized avatar
🏠
Working from home

Richard solleer

🏠
Working from home
View GitHub Profile
@heathdutton
heathdutton / upgrade-php7.sh
Last active January 12, 2024 07:47
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
#
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
#
# Must be ran as sudo:
# sudo bash upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
@ignovak
ignovak / whitespace.js
Last active October 24, 2016 00:17
Whitespace Interpreter
// https://www.codewars.com/kata/52dc4688eca89d0f820004c6/
class Stack {
constructor() {
this.stack = []
}
push(x) {
return this.stack.push(x)
}
pop() {
if (!this.len) throw Error
@solleer
solleer / Readable.php
Last active April 12, 2017 01:26
Transphporm Readable Formatter
<?php
namespace Config\Transphporm\Readable;
class Readable {
private function camelCase($val) {
$words = preg_split('/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/', $val);
return implode(' ', $words);
}
public function readable($val, $splitOnDashes = false) {
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n