Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Chun-Sheng, Li peter279k

🎯
Focusing
Block or report user

Report or block peter279k

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@peter279k
peter279k / .profile
Created Apr 8, 2019 — forked from edwinksl/.profile
Default .profile for Ubuntu 16.04 copied from /etc/skel/.profile
View .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
View 我的 Vim.md

我的 Vim 指令筆記

vim 的三種模式

模式

  • 輸入模式:輸入內文。
  • 指揮模式:也叫指令模式,主要是進入到可以對文件做修改,複製,剪下貼上,游標移動等動作。
  • 執行模式:文件存檔,離開等等行為。

常用模式的切換

  • 輸入模式 -> 指揮模式 : 鍵盤 Esc
View 我的 Vim.md

#我的 Vim 指令筆記

##vim 的三種模式 ###模式

  • 輸入模式:輸入內文。
  • 指揮模式:也叫指令模式,主要是進入到可以對文件做修改,複製,剪下貼上,游標移動等動作。
  • 執行模式:文件存檔,離開等等行為。

###常用模式的切換

  • 輸入模式 -> 指揮模式 : 鍵盤 Esc
View EmailValueObject.php
<?php
final class EmailValueObject
{
private $mailbox;
private $host;
public function __construct($email)
{
if (false === strpos($email, '@')) {
@peter279k
peter279k / fcitx-chewing.png
Created Jul 2, 2018 — forked from tanyuan/fcitx-chewing.png
Ubuntu: fcitx + chewing 新酷音輸入法
@peter279k
peter279k / massInsertOrUpdate.php
Created Jun 28, 2018 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
View massInsertOrUpdate.php
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@peter279k
peter279k / array_zip.php
Created Jun 10, 2018 — forked from castarco/array_zip.php
PHP's array_zip
View array_zip.php
<?php
declare(strict_types=1);
function array_zip(array ...$arrays): array
{
// Applied suggestion from reddit
// https://www.reddit.com/r/PHP/comments/76czco/php_equivalent_of_pythons_zip_function/doe5j86/
return \array_map(null, ...$arrays);
}
@peter279k
peter279k / gist:6c60c66660f534e9488a4cbc52714ab6
Created Apr 11, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:6c60c66660f534e9488a4cbc52714ab6

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@peter279k
peter279k / how-to-git-archive.txt
Created Feb 13, 2018 — forked from simonw/how-to.txt
How to create a tarball of a git repository using "git archive"
View how-to-git-archive.txt
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
View Mailgun PHP API with curl
function mg_send($to, $subject, $message) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, 'api:'.MAILGUN_API);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$plain = strip_tags(br2nl($message));
You can’t perform that action at this time.