Skip to content

Instantly share code, notes, and snippets.

@eyedroot
eyedroot / laravel-ci-cd-workflow.yml
Created September 28, 2022 16:21 — forked from JustinByrne/laravel-ci-cd-workflow.yml
Github Action to test laravel and then compile the assets to a production branch
name: CI/CD workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
testing:
@eyedroot
eyedroot / docker-compose.yml
Created September 3, 2022 23:05
thesolo docker-compose.yml
version: '3'
services:
laravel.test:
build:
context: ./docker/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: thesolo-8.1/app
extra_hosts:
@eyedroot
eyedroot / docker-compose.yml
Created September 3, 2022 22:58
thesolo docker-compose.yml
# For more information: https://laravel.com/docs/sail
version: '3'
services:
laravel.test:
build:
context: ./docker/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: thesolo-8.1/app
@eyedroot
eyedroot / php_object_to_array.php
Created August 27, 2019 04:15 — forked from victorbstan/php_object_to_array.php
recursively cast a PHP object to array
<?php
/*
This function saved my life.
found on: http://www.sitepoint.com/forums//showthread.php?t=438748
by: crvandyke
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?!
*/
$array = json_decode(json_encode($object), true);
@eyedroot
eyedroot / build.gradle
Created August 20, 2019 10:59
안드로이드 개발 컴파일 빠르게
android {
...
flavorDimensions "stage", "mode"
productFlavors {
dev {
dimension "stage"
versionCode 100
minSdkVersion 21
aaptOptions.cruncherEnabled = false
/**
* 위임 프로퍼티가 유용하게 사용되는 몇 가지 기능
*
* by Lazy()
*
* '지연 초기화(Lazy Initialization)'는 프로퍼티의 초기화를 객체를 생성할 때 하지 않고
* 필요할 때 초기화하는 패턴이다.
*
* 예를 들어 객체 생성시 서버에 연결하고, 연결이 완료되면 데이터를 수신해서
* 프로퍼티에 값을 넣는 경우
@eyedroot
eyedroot / PropertyDelegation.kt
Created August 13, 2019 06:02
코틀린 프로퍼티 위임 (Delegated Property)
import kotlin.reflect.KProperty
/**
* 위임 프로퍼티란
*
* 프로퍼티 필드에 접근하는 접근자 로직을 다른 객체에 맡기는 방식을 말한다.
* 즉, 게터와 세터 메서드를 가지는 다른 객체를 만들어서 그 객채에 프로퍼티의 플드 접근로직을 위임하는 것.
*/
fun main(args: Array<String>) : Unit {
@eyedroot
eyedroot / for.kt
Created July 22, 2019 12:44
for in .. downTo step until arrayListOf strList.withIndex() TreeMap
package my.demo
import java.util.*
/**
* `downTo`, `step`, `until` 등은 모두 일반 메서드이고, `중위 호출(Infix Calls)`이라는 방식을 사용하기 때문에
* 일반 함수 호출과 달리 키워드 처럼 사용할 수 있다.
* 중위 호출 이란 매개변수가 하나뿐인 메서드를 호출할 때 간단하게 호출 할 수 있게 하기 위한 방법
* 함수 선언 앞에 `infix`라는 키워드를 붙여 선언하면 사용 할 수 있다.
*/
@eyedroot
eyedroot / InWhileDoWhile.kt
Created July 22, 2019 12:29
in while do while setOf
package my.demo
fun isLetter(c: Char) = c in 'a'..'z' || c in 'A'..'Z'
fun isNotDigit(c: Char) = c !in '0'..'9'
fun main(args: Array<String>): Unit {
var x = 10
val oneToTen: IntRange = 1..10
println(oneToTen)
@eyedroot
eyedroot / IfWhen.kt
Created July 22, 2019 12:20
if when range function
package my.demo
fun getMax(a: Int, b: Int): Int {
var max = 0
if (a < b) max = b else max = a
return max
}
fun getMaxShort(a: Int, b: Int): Int = if (a < b) b else a