»

Debugging PHP code with PhpStorm 7

Log — Tags: , — Posted by Starck on September 11, 2014


  1. Install Xdebug

  2. Modify your php.ini:

  1. Restart web server

  2. Start PhpStorm

  3. Open Run/Debug configuration

  4. Create a PHP Web Application configuration

  5. Install Xdebug helper Chrome extension

  6. Enable xdebug debugging in chrome browser

  7. Start listen for PHP Debug Connections in PhpStorm 7

  8. Done!

[Font] Brandon Text

Design — Tags: — Posted by Starck on July 20, 2014

104031

104032

Brandon Text 是被設計用來搭配著名的 Brandon Grotesque 系列字體, 它擁有較高的基本高度 (x-height), 比起 Grotesque 來說更適合應用在字幅較長的段落和小尺寸的裝置螢幕。

Brandon Text is the companion of the famous Brandon Grotesque type family. It has a higher x-height than the Grotesque version and is optimized for long texts, small sizes and screens.

總共有六種不同 粗細/字重 (weight) 和斜體的無襯線字型是在 2012 年由 Hannes von Döhren 所設計的。

This sans serif type family of six weights plus matching italics was designed by Hannes von Döhren in 2012.


brandon-text


受到在20到30年代間很流行的無襯線幾何造形風格的影響,這種幾何形狀的字體在閱讀上能有更好的視覺辨識性與易讀性。Brandon Text 看起來相當舒服,並可與 Brandon Grotesque 可以完美的搭配在一起。為了在螢幕的呈現而作了許多微調和優化所以把它運用在網站、電子書與應用程式上是個不錯的選擇。

Influenced by the geometric-style sans serif faces that were popular during the 1920s and 30s, the fonts are based on geometric forms that have been optically corrected for better legibility. Brandon Text has a functional look with a warm touch and works perfectly together with Brandon Grotesque. It is manually hinted and optimized for screens, so it will be a good choice for Websites, eBooks or Apps.

The whole Brandon series is equipped for complex, professional typography with different sets of numbers, alternate letters, fractions and an extended character set to support Central and Eastern European as well as Western European Languages.

The riddle of experience vs. memory

Log — Tags: , — Posted by Starck on July 6, 2014

近十幾年來,科學家努力想解釋「快樂」該怎麼定義,如何產生與量化衡量。Daniel Kahneman 似乎在認知心理學的基礎下,提出人有兩種自我的概念:「記憶的自我」(Remembering self)和「經驗的我」(Experiencing self),並試圖用這兩種視角,解釋我們如何看待快樂。

這樣的二分法,源自他的新書 Thinking, Fast and Slow 所說的,系統一和系統二,可以聽聽看他在 google 的演講。

Pixel Art

Design — Tags: — Posted by Starck on July 4, 2014

little prince

maskman

How can chroot sftp-only SSH users into their homes?

Log — Tags: , , — Posted by Starck on June 8, 2014

Here is a guide for setting up SFTP users who’s access is restricted to their home directory.

/etc/ssh/sshd_config

Notes: (Important!)

If you got the login failed message:

Write failed: Broken pipe

Change the user and access permission:

Installing PHP5 Twig Extension

Log — Tags: , , — Posted by Starck on April 17, 2014

Environment: Ubuntu

The PHP5 source needed for compiling additional modules

sudo apt-get install gcc php5-dev

Compiling Twig Source Code

Installation

PHP5

vim /etc/php5/conf.d/twig.ini

PHP5-FPM

vim /etc/php5/fpm/conf.d/twig.ini

Add the following to your twig.ini file

Restarting

PHP5

sudo service apache2 restart

PHP5-FPM

sudo service php5-fpm restart

PhpStorm 7.x 中文輸入問題

Log — Tags: — Posted by Starck on April 17, 2014

/Applications/PhpStorm.app/bin 中找到 idea.vmoptions

最後一行加上參數: -J-Djava.awt.im.style=on-the-spot

先切換中文輸入法後再啟動 PhpStorm 即可

Custom Composer Repositories

Coding, Log — Tags: , — Posted by Starck on April 12, 2014

Define a composer repository

composer.json:

Require a custom repository

composer.json:

p.s. Composer 讀取版本的依據是 Repository 上的 Tag

Disable Packagist repository source

You can disable the default Packagist repository by adding this to your composer.json:

Bootflat – an opensource Flat UI Kit based on Bootstrap 3.1.1

Design — Posted by Starck on April 12, 2014

Site

繼 Designmodo 的 Flat UI 後,又一個不錯的 CSS Framework。

Source

PSD files

非暴力抗爭

Log — Tags: — Posted by Starck on April 7, 2014

問題

我們在不使用暴力的情況下,如何面對極端暴力?當你面對暴力,不管是一個小孩面對欺負他的小混混,還是家庭暴力或者是敘利亞今天的街道上,面對坦克和彈藥,最有效的方式是什麽?

反擊?屈服?使用更多暴力?

反思這個問題在目前的行動當中得不到答案

意識到我真正需要的,卻是我從目前訓練中得不到的。我真正想知道「暴力」「壓迫」有什麽作用。

我發現:惡棍使用三種暴力。

政治暴力來威懾,肉體暴力來恐嚇,以及精神暴力來摧毀。並且用更多的暴力幾乎不起作用。

綀習面對害怕

我需要的就是增長知識。 這意味著當我垮掉時 我要知道如何保持平衡,我的優點在哪,我的弱點在哪。我什麽時候屈服?我爲了什麽堅持?冥想或自我反思,這是一種方式,當然也不是唯一的方式,而我選擇透過這種方式,來獲得這種內在的力量。

引用例子:

我心目中一個理想型的英雄是在緬甸的 Aung San Suu Kyi (翁山蘇姬),她是一群在 Rangoon (緬甸仰光)的學生抗議團隊的領導者。他們面對一排機關槍,她立刻意識到在扳機上手抖動的士兵,比學生抗議者更害怕。 但她告訴學生坐下。然後她以出奇的冷靜,無畏,走向第一個槍,把她的手放上去,把槍放下來,所有人都安全了。

這就是控制恐懼能做的。不僅當面對機關槍時,更是當你在路上遇到刀戰。但我們必須練習。那麽我們害怕什麽呢?我有一箴言。「我越害怕,我的恐懼越大。如果恐懼太大了,不好的事情就會發生了。」

綀習將憤怒化為正面的力量

所以這就是恐懼。那憤怒呢?只要有不公正就有憤怒。但憤怒像汽油,如果你潑出汽油,然後有人點了一個火柴,那你就在地獄裏了。但作爲引擎,憤怒是很有力的。如果我們能把憤怒放入引擎裏,他能帶我們向前,他能讓我們走過悲慘的時刻,能給我們真正的內部力量。

溝通

我在和核武器政策制定者的工作中知道了這個。因爲一開始我對於他們給我們帶來的危險感到很憤怒,以至於我想辯論,責備,並且讓他們感到錯誤。但這根本不管用。爲了開始一個能夠帶來改變的對話,我們需要應付我們的憤怒。對於制定核武器的行為感到憤怒是很正常,但對人憤怒是沒有用的。他們和我們一樣是人。他們在做他們認爲對的。 而這就是我們和他們交流的基礎。

註譯: 如果我們認為我們正在做一件對的事情,那麼我們也需要先同意對方也在做一件他們認為對的事情。

是什麼帶來改變

所以這就是第三個,憤怒。現在我們來到了這次演講的核心,也就是現在在這個世界正在發生什麽?在上個世紀是由上而下的權利。過去政府仍然告訴人們該做什麽。這個世紀有了變化。現在是由下而上或者說草根權利。想從混凝土中長出的蘑菇。像 Bundy 所說,是人和人連結在一起,而帶來改變。

結論

重新認識自我,並運用我們的恐懼,把憤怒化作燃料,與他人合作,和他人結合在一起,勇氣,以及最重要的,積極的非暴力抗爭與溝通。

Next Page »
(c) 2024 Starck Lin | powered by WordPress