Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / gist:3052671
Created July 5, 2012 09:46
C# Controls abbreviation
btn Button chk CheckBox ckl CheckedListBox
cmb ComboBox dtp DateTimePicker lbl Label
llb LinkLabel lst ListBox lvw ListView
mtx MaskedTextBox cdr MonthCalendar icn NotifyIcon
nud NumeircUpDown pic PictureBox prg ProgressBar
rdo RadioButton rtx RichTextBox txt TextBox
tip ToolTip tvw TreeView wbs WebBrowser
容器
flp FlowLayoutPanel grp GroupBox pnl Panel
@andyyou
andyyou / gke-gce-cloud-armor-lb.sh
Created February 10, 2023 07:19 — forked from pydevops/gke-gce-cloud-armor-lb.sh
Example Cloud Armor policies protecting Google HTTPS Global Load Balancer in front of GCE instance group and GKE cluster
#!/usr/bin/env bash
# REF: https://cloud.google.com/armor/docs/integrating-cloud-armor#with_ingress
# REF: https://cloud.google.com/armor/docs/configure-security-policies
# REF: https://cloud.google.com/iap/docs/load-balancer-howto
# REF: https://cloud.google.com/sdk/gcloud/reference/compute/url-maps/add-path-matcher
# REF: https://cloud.google.com/load-balancing/docs/https/setting-up-url-rewrite
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@andyyou
andyyou / rails_webpacker_bootstrap_expose_jquery.md
Last active August 9, 2022 07:38
Rails 5.2 with webpacker, bootstrap, stimulus starter

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@andyyou
andyyou / iterm2-solarized.md
Created September 30, 2015 13:58 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@andyyou
andyyou / Markdium-Hack.php
Created October 23, 2020 06:01
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
use App\Http\Controllers\Auth\LoginController;
Route::get('/login/{provider}', [LoginController::class, 'redirectToProvider'])
->name('social.login');
Route::get('/login/{provider}/callback', [LoginController::class, 'handleProviderCallback'])
->name('social.callback');
@andyyou
andyyou / Markdium-Hack.php
Created October 23, 2020 06:01
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
use Illuminate\Database\Eloquent\SoftDeletes;
// ...
// If you want to support verify you can add implements
class User extends Authenticatable
{
use Notifiable;
use SoftDeletes;
// ...
@andyyou
andyyou / Markdium-Hack.php
Last active October 28, 2020 07:05
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
<div>
@php
$providers = [
'google' => [
'bgColor' => '#ec462f',
'icon' => 'fab fa-google',
],
'facebook' => [
'bgColor' => '#1877f2',
'icon' => 'fab fa-facebook-f',
@andyyou
andyyou / Markdium-Hack.php
Last active October 28, 2020 06:35
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Auth\LoginController;
// ...
Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
return Inertia\Inertia::render('Dashboard');
})->name('dashboard');
@andyyou
andyyou / Markdium-Hack.php
Last active October 28, 2020 06:33
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Socialite;
@andyyou
andyyou / Markdium-Hack.php
Created October 23, 2020 06:01
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
// app/Actions/Fortify/CreateNewUser.php@create
// app/Actions/Fortify/UpdateUserProfileInformation.php@update
// unique rule
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email,NULL,id,deleted_at,NULL'],
'password' => $this->passwordRules(),
])->validate();