Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / gist:3052671
Created July 5, 2012 09:46
C# Controls abbreviation
View gist:3052671
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
View gke-gce-cloud-armor-lb.sh
#!/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
View rails_webpacker_bootstrap_expose_jquery.md

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)
@andyyou
andyyou / Markdium-Hack.php
Created October 23, 2020 06:01
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
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
View Markdium-Hack.php
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
View Markdium-Hack.php
<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
View Markdium-Hack.php
<?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
View Markdium-Hack.php
<?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-Shell.sh
Created October 23, 2020 06:01
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Shell.sh
$ composer require laravel/jetstream
$ php artisan jetstream:install inertia --teams
$ npm install && npm run dev
# (opt) For customize template you should publish these views
$ php artisan vendor:publish --tag=jetstream-views