Skip to content

Instantly share code, notes, and snippets.

View justinmoh's full-sized avatar

Justin Moh justinmoh

View GitHub Profile
@justinmoh
justinmoh / styles.csv
Created April 28, 2024 09:32 — forked from jonshipman/styles.csv
Stable Diffusion Artist Styles
____Artists____
Aaron Horkey style of Aaron Horkey
Abbott Handerson Thayer style of Abbott Handerson Thayer
Abigail Larson style of Abigail Larson
Adam Hughes style of Adam Hughes
Adrian Ghenie style of Adrian Ghenie
Adrian Tomine style of Adrian Tomine
Adrianus Eversen style of Adrianus Eversen
Agnes Cecile style of Agnes Cecile
Agostino Arrivabene style of Agostino Arrivabene
@justinmoh
justinmoh / pass-slots.md
Created May 26, 2023 07:51 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@justinmoh
justinmoh / nginx.conf
Created November 15, 2022 10:55 — forked from jpcaparas/nginx.conf
Make a node application work with PM2 & Laravel Forge
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/<your-site>/before/*;
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
@justinmoh
justinmoh / snippet.md
Created November 15, 2019 11:39
Disable touching `updated_at` upon updating an Eloquent model.

While you have $timestamp = true; inherited from Model, you can disable touching updated_at timestamp by explicitly assigning 'timestamp' => false in the attributes.

MyModel::first()->update(
    [
        'name' => 'Justin',
        'timestamp' => false
    ]
);
@justinmoh
justinmoh / Homestead-slash-after.sh
Last active May 5, 2016 13:25
Homestead setup for extra development toolsets.
#!/usr/bin/env bash
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
wanted_packages="php7.0-intl";
################################################################################
# General
@justinmoh
justinmoh / .bash_profile
Last active January 10, 2016 07:15
Terminal Settings
# Format terminal prompt
function __format_ps1() {
local cursor_position
echo -en '\033[6n'
IFS=';' read -s -d R -a cursor_position
(( cursor_position[1] > 1 )) && PS1='\n' || PS1=''
export PS1+='\[$(tput bold)\]+[\[$(tput sgr0)\]\W\[$(tput bold)\]]: \u\[$(tput sgr0)\]\$ '
}
export PROMPT_COMMAND=__format_ps1
@justinmoh
justinmoh / recursiveSimpleXmlToArray.php
Last active January 7, 2016 04:20
A function that recursively convert SimpleXmlElement object to associate array ignoring Xml Attributes. Code credit to @hakre: http://stackoverflow.com/a/15849257/4520373
<?php
/**
* Xml to associated array without Attributes fields. Credit to 'hakre':
* @url http://stackoverflow.com/a/15849257/4520373
*
* @param \SimpleXMLElement $parent
*
* @return array
*/
function recursiveSimpleXmlToArray(\SimpleXMLElement $parent)
@justinmoh
justinmoh / umount-partitions.sh
Created January 7, 2016 03:39
A script to unmount your **unwanted** drives / partitions. Use conjunction with Automator, and add it into User's Login Items to allow automatic unmount on system startup. You can easily mount them back with Disk Utility.
#!/usr/bin/env bash
diskutil umount "Install OS X Yosemite"
diskutil umount "System Clone"
exit