Skip to content

Instantly share code, notes, and snippets.

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

Kang Yoosam KangYoosam

🏠
Working from home
View GitHub Profile
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active March 20, 2024 21:24
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@arikfr
arikfr / README.md
Last active January 17, 2024 11:23
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
@sandabu
sandabu / Example.php
Last active February 7, 2022 12:14
Stripe API Japanese Error Messages
<?php
//Composerでstripe/stripe-php をrequire済み
require_once __FILE__. './jp.php';
try{
Stripe\Stripe::setApiKey('sk_test_YOUR_KEY');
Stripe\Charge::create([]);
}catch(Stripe\Error\Base $e) {
$err = $e->getJsonBody()['error'];
if(key_exists('code', $err)) {
############################################################################
# Sample Algorithm
import pandas as pd
import talib as ta
import numpy as np
def initialize(ctx):
# 設定
ctx.logger.debug("initialize() called")
@BenSampo
BenSampo / deploy.sh
Last active March 23, 2024 05:30
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@davidpiesse
davidpiesse / Schedulable.php
Last active September 7, 2023 15:22
Laravel Custom Class/Model Scheduling
<?php
//Don't forget to change the namespace!
namespace App\Traits;
use Cron\CronExpression;
use Illuminate\Support\Carbon;
use Illuminate\Console\Scheduling\ManagesFrequencies;
trait Schedulable{
@brunogaspar
brunogaspar / macro.md
Last active March 7, 2024 16:26
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@utgwkk
utgwkk / mysql-accumlate.md
Last active May 30, 2023 09:34
詳説 MySQLで累積和を求める方法

MySQL で累積和を求める方法

SELECT
    t1.accum_date
 , t1.count
When building an adnroid app, you might stumble upon this error:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE...`. Here's how to fix it:
That's because the app you're trying to test was already installed on the device and the signatures are different now, so it's complaining. The full error will look like something like this:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example signatures do not match the previously installed version; ignoring!`
You can see that the package ID is `com.example`, well, simply run this command:
@suin
suin / README.md
Last active May 14, 2018 12:32
iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。

iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。英語名のポケモンじゃ分からない人向けです。例えば、イーブイにしたいときpokemon eeveeと打たないといけないところが、このデータをインストールするとpokemon i-buiでできるようになります。

インストール方法

Pokemon-Terminalをインストールした後に次のコマンドを実行して、ポケモン名データを書き換えてください

wget https://gist.githubusercontent.com/suin/7ba1e2b7a1feb5d0c01a6756f736d24d/raw/b210c99b105cf1a4a6854a55cf3d2f95dc981eba/pokemon.txt -O $HOME/.Pokemon-Terminal/Data/pokemon.txt