Skip to content

Instantly share code, notes, and snippets.

View PhillipMwaniki's full-sized avatar
🤓
Who's checking ...

Phillip Mwaniki Nzuli PhillipMwaniki

🤓
Who's checking ...
View GitHub Profile
@sdavara
sdavara / Git-Pre-commit-setup.md
Last active July 25, 2023 16:36
Git-pre-commit-hooks for PHP/Laravel Project

Pre Commit Setup

Setup pre-commit hook in php projects for lint, code standard, test cases etc.

Prerequisites

  • php >= 5.6
  • composer
  • git

Installation

@ajdruff
ajdruff / fix-git-line-endings
Last active March 4, 2025 00:01
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@chesio
chesio / wordpress-apache-hardening.md
Last active March 17, 2025 10:06
Some common rules to harden WordPress running on Apache webserver
@lepfsd
lepfsd / useful google drive links
Created August 11, 2017 05:21
useful google drive links
@adamwathan
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
Promise.takeAtLeast
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
@SteveKamau72
SteveKamau72 / TimeTask.java
Created July 11, 2017 07:16
Get time differences between current time and future a date.
package com.girlathome.utilities;
import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@btroncone
btroncone / ngrxintro.md
Last active March 5, 2025 20:40
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@MwirabuaTimothy
MwirabuaTimothy / AppDebug.php
Last active January 13, 2016 19:36
Laravel artisan command for switching between debug modes for your app. Usage `php artisan app:debug true` and `php artisan app:debug false`
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class AppDebug extends Command {
/**
* The console command name.
@MwirabuaTimothy
MwirabuaTimothy / helpers.php
Last active June 20, 2016 07:15
laravel helper functions
<?php
/**
* Return a success response
*
* @return Response
*/
function success($message, $redirectUrl, $record=null)
{