Skip to content

Instantly share code, notes, and snippets.

View calebklc's full-sized avatar
🤯
I may be slow to respond.

KwanLam Chan calebklc

🤯
I may be slow to respond.
  • Hong Kong
  • 03:09 (UTC +08:00)
View GitHub Profile
@wxingheng
wxingheng / js对象扁平化与反扁平化
Created February 13, 2019 09:24
js对象扁平化与反扁平化
```language
Object.flatten = function(obj){
var result = {};
function recurse(src, prop) {
var toString = Object.prototype.toString;
if (toString.call(src) == '[object Object]') {
var isEmpty = true;
for (var p in src) {
isEmpty = false;
@nikgraf
nikgraf / .eslintrc.js
Last active July 12, 2019 19:11
Prettier / Eslint Setup
module.exports = {
root: true, // make to not take in any user specified rules in parent folders
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'prettier/flowtype', 'prettier/react'],
env: {
browser: true,
node: true,
jest: true,
},
plugins: ['flowtype'],
@bgarrant
bgarrant / ValetSwitchPHP.md
Last active September 30, 2022 08:08
How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

Valet switch PHP version with these commands

Install PHP 5.6 and switch Valet to PHP 5.6

valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
@Clivern
Clivern / install-tomcat-8.5.14.sh
Last active January 7, 2020 01:07
How to Install Apache Tomcat 8 on Ubuntu 16.04
#!/bin/bash
# For More Info http://clivern.com/how-to-install-apache-tomcat-8-on-ubuntu-16-04
sudo apt-get update
sudo apt-get install default-jdk
sudo apt-get install unzip
cd /opt
curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.zip
sudo unzip apache-tomcat-8.5.15.zip
sudo mv apache-tomcat-8.5.15 tomcat
@v-jacob
v-jacob / Mailhog Bash Script (systemd)
Last active January 9, 2023 08:51
Mailhog setup with systemd
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
# Make it executable
chmod +x ~/mailhog
@rhwilr
rhwilr / Awesome-PHP-Development-Environment-on-Arch.md
Last active February 17, 2022 22:34
This is my awesome php development environment

Introduction

The following steps are required for a typical web developer stack for php and some front-end development. This is for a developer machine and not for a live environment!

Installation stack

@agentgt
agentgt / One Dark.icls
Last active January 8, 2019 07:03
Intellij Atom One Dark theme
<scheme name="One Dark" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="CONSOLE_FONT_NAME" value="Monospaced" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="abb2bf" />
<option name="ANNOTATIONS_COLOR" value="ffffff" />
<option name="ANNOTATIONS_MERGED_COLOR" value="ffffff" />
<option name="CARET_COLOR" value="61afef" />
@TahaSh
TahaSh / helpers.php
Last active May 27, 2017 20:24
Source code: How to Create a Reusable Modal Box in Laravel & VueJS
<?php
function showModal($id, array $data = [])
{
$toJSON = json_encode($data);
return "showModal('$id', $toJSON)";
}
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active February 24, 2024 13:40
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware