Skip to content

Instantly share code, notes, and snippets.

View bobo52310's full-sized avatar
🎯
Focusing

Bobo Chen (陳柏宏) bobo52310

🎯
Focusing
View GitHub Profile
@bobo52310
bobo52310 / mac-dev-playbook-config.yml
Last active May 13, 2022 08:33
Bobo's new macOS 安裝套件清單 with ansible
---
downloads: ~/.ansible-downloads/
configure_dotfiles: false
configure_terminal: false
configure_osx: false
# Set to 'true' to configure the Dock via dockutil.
configure_dock: false
dockitems_remove:
@bobo52310
bobo52310 / gist:61fa448021facde499b5
Last active February 24, 2021 03:21
Laravel Coding Style and Naming Guidelines 整理

#Laravel Coding Style

據英國研究統計,工程師每天花費最多時間就是在 Naming,變數的命名、Function 的命名... 而且很容易發生爭執 我這邊參考了 PHP 常見的 Framework 整理出一份 Guidelines,來當做我們團隊的 Naming Guidelines,讓大家在開發時可以有個準則放在心上:

Naming Guidelines

  • ClassName:使用 PascalCase。
  • methodName:使用 camelCase。 >* propertyName:使用 camelCase。
@bobo52310
bobo52310 / gist:687045522118af4c2e92ce8857146a04
Created November 15, 2018 07:42
How to jump to anchor BEFORE page loads completely?
// ref: https://stackoverflow.com/questions/43232931/how-to-jump-to-anchor-before-page-loads-completely
function autoScroll(name, animated, distance){
var scrollDistance = distance;
var scrollTarget = $("*[name='"+name+"']");
if(animated){
$('html, body').animate({scrollTop: (scrollTarget.offset().top - scrollDistance)}, 1300);
}
else{
@bobo52310
bobo52310 / feedly-elixir-phoenix-rss.opml
Created October 29, 2017 06:26
feedly-elixir-phoenix-rss.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Bobo's feeds of Elixir</title>
</head>
<body>
<outline text="Elixir Phoenix" title="Elixir Phoenix">
<outline type="rss" text="via @codeship" title="via @codeship" xmlUrl="http://blog.codeship.com/feed/" htmlUrl="https://blog.codeship.com"/>
<outline type="rss" text="元气糯米团子的Coding Blog" title="元气糯米团子的Coding Blog" xmlUrl="http://developerworks.github.io/atom.xml" htmlUrl="http://developerworks.github.io/"/>
@bobo52310
bobo52310 / gist:29f9da3136f5d9c71af7
Created November 17, 2014 00:37
Sublime Text 必安裝的套件
官網上 TOP100 的套件都值得一看(https://sublime.wbond.net/browse/popular),以下這些套件不分前後端都是強烈推薦安裝:
SideBarEnhancements // 增強側欄功能
BracketHighlighter // 大小括號的匹配自訂顏色提醒
DocBlockr // 產生對應的各種程式語言的註解
SublimeCodeIntel // syntax 檢驗
emmet // HTML的簡碼快速輸入
EasyMotion // 很有趣的快速純鍵盤游標移動
FileDiffs // 檔案差異比對、也可以跟其他檔案比對,或是比對剪貼簿的內容。
All Autocomplete // 自動補齊此套件可以加強到批配所有開啟的分頁
@bobo52310
bobo52310 / icdiff.md
Created January 9, 2016 05:45
Terminal 環境下更好用的檔案比較差異工具(diff tools) 推薦使用 `icdiff` 這一套

Terminal 環境下更好用的檔案比較差異工具(diff tools)

推薦使用 icdiff 這一套:https://github.com/jeffkaufman/icdiff

用法:

如何比較兩個檔案差異:

$icdiff <file_1> <file_2>

備註:覺得好用的話,可以將內建的 diff 指令改用 icdiff。

@bobo52310
bobo52310 / gist:31f1bb146e4fcc4025c115ead2792d4f
Created July 28, 2016 09:34
elixir pipeline for enumeration
:inet.getif()
|> elem(1)
|> hd()
|> elem(1)
|> Tuple.to_list
|> Enum.join(".")
|> IO.inspect
# ip1 = :inet.getif()
# ip1 = elem(ip1, 1)
@bobo52310
bobo52310 / bobo_mac_apps.txt
Created June 5, 2016 02:39
Mac 上必裝的 Apps
1Password 6.app
Adobe Acrobat Reader DC.app
AppCleaner.app
Bartender 2.app
BetterTouchTool.app
Dropbox.app
Evernote.app
FileZilla.app
Firefox.app
Google Chrome.app
@bobo52310
bobo52310 / laracon2016.md
Last active March 7, 2016 03:19
Laracon EU2016

會議時間

8/23、8/24 兩天

預計出差日期

8/20~8/28 (台灣時間)

會議地點:

荷蘭 Amsterdam 2016年場館尚未公佈,參考2015年是舉辦在 Royal Tropical Institute(Mauritskade 63 1092 AD Amsterdam the Netherlands)

@bobo52310
bobo52310 / gist:7100937
Created October 22, 2013 13:39
FB.ui 回po訊息到塗鴉牆上
FB.ui({
method: 'feed',
name: '<?= $fb_share_title; ?>',
link: '<?= current_url(); ?>',
picture: '<?= $fb_share_img; ?>',
//caption: '<?= $meta_description;?>',
description: '<?= $fb_share_text; ?>'
},
function(response) {
if (response && response.post_id) {