Skip to content

Instantly share code, notes, and snippets.

View Leon0824's full-sized avatar
🎵
NP: 好好 (Anni Hung) (3:11/3:11)

Leon Leon0824

🎵
NP: 好好 (Anni Hung) (3:11/3:11)
View GitHub Profile
Task 1: Create a project jumphost instance
Navigation menu > Compute engine > VM Instance
Task 2: Create a Kubernetes service cluster
gcloud config set compute/zone us-east1-b
gcloud container clusters create nucleus-webserver1
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active June 28, 2024 19:01
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *

Given a subscribed calendar with a url like

https://example.com/example.ics

To force Google Calendar to refresh and reload the contents right now, unsubscribe from the calendar and subscribe to a new calendar with a URL like

https://example.com/example.ics#1

Adding the anchor tag will force Google Calendar to think of it as a new calendar

@iansrc0811
iansrc0811 / books_crawler.rb
Last active June 25, 2019 07:53
爬博客來書名的爬蟲
require 'rubygems'
require 'nokogiri'
require 'mechanize'
require 'open-uri'
class Books_Crawler
def get_book_names(book_name)
book_item = self.start_crawler(book_name)
book_names = []
@pirafrank
pirafrank / .lftp.mockup.rc
Created December 10, 2016 12:05 — forked from gaubert/.lftp.mockup.rc
~/.lftp.rc parameters detailed
########## SETTINGS
# On startup, lftp executes ~/.lftprc and ~/.lftp/rc. You can place aliases and 'set' commands
# there. Some people prefer to see full protocol debug, use 'debug' to turn the debug on.
# Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is time amount
# (floating point) and x is time unit: d - days, h - hours, m - minutes, s - seconds. Default unit is second. E.g.
# 5h30m or 5.5h. Also the interval can be 'infinity', 'inf', 'never', 'forever' - it means infinite interval. E.g.
# 'sleep forever' or 'set dns:cache-expire never'.
Rails on Rails Cheat Sheet -- Includes updates from Rails 5.0
1. Open terminal and check versions of Ruby and Rails against production server params or to make sure you are using the most recent stable versions.
$ ruby -v
$ rvm list
$ rvm list known
$ rvm install ruby 2.3.1
$ rvm list
$ ruby -v
$ gem install rails
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@darkthread
darkthread / gist:ae3f31823fc975b1b90f13fbb073b893
Last active August 25, 2018 01:31 — forked from CristinaSolana/gist:1885435
讓Fork與源頭保持同步

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@mdang
mdang / RAILS_CHEATSHEET.md
Last active June 26, 2024 00:37
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@wastemobile
wastemobile / FirstSolution
Last active November 9, 2020 14:23
使用Git與Git Hooks同步專案MySQL資料庫
使用 Git 與 Git Hooks 同步 MySQL 資料庫
=====================================
參考來源: [Synchronizing a MySQL Database with Git and Git Hooks](http://ben.kulbertis.org/2011/10/synchronizing-a-mysql-database-with-git-and-git-hooks/)
目前採用的方法,也是利用 Git Hooks,基本有兩個:
1. push-db:將本地異動推到遠端前運行,讓本地資料庫 => 遠端資料庫(pre-push)。
2. pull-db:將遠端異動拉回本地後運行,讓遠端資料庫 => 本地資料庫(post-update)。