Skip to content

Instantly share code, notes, and snippets.

@fatgy
fatgy / story.md
Created April 11, 2017 03:53
Job Stories

When I _____, I want to _______, so that I can __________.

For example:

When I am viewing my dashboard, I want to check my account balance, so that I quickly know how much money I have left without leaving the dashboard.

via The Complete Guide to the Product Design Process

@fatgy
fatgy / user.js
Last active July 5, 2016 07:32
Add chart link for thai stock symbol in settrade market summary page
// ==UserScript==
// @name Add stock chart to symbol
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shows how to use babel compiler
// @author You
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.min.js
// @match http://www.settrade.com/C13_MarketSummary.jsp*
// ==/UserScript==
@fatgy
fatgy / baum-traversal.php
Last active August 29, 2015 14:13
traversal baum collection
function render($html, $node)
{
if($node->isRoot()) $html .= '<ul>';
$html .= '<li>' . $node->name;
if($node->children->count() > 0)
{
$html .= '<ul>';
$html .= $node->children->reduce(render);
@fatgy
fatgy / readme.md
Created January 5, 2015 04:34
Laravel PHPUnit and Mockery snippets.
  • Always mockery close so put in teardown
class FooControllerTest extends TestCase {

  public function tearDown()
  {
    parent::tearDown();
    Mockery::close();
 }
@fatgy
fatgy / sublime-setting
Created September 21, 2014 14:28
My sublime setting
{
"bold_folder_labels": true,
"caret_style": "smooth",
"default_encoding": "UTF-8",
"detect_slow_plugins": false,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": true,
"font_options": "subpixel_antialias",
"font_size": 14,
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
@fatgy
fatgy / snip.php
Created March 25, 2014 08:29
Laravel snippet
//Check db connection
if(DB::connection()->getDatabaseName())
{
echo "conncted sucessfully to database ".DB::connection()->getDatabaseName();
}
@fatgy
fatgy / testThreeMonths.php
Created March 4, 2014 10:58
Test three month for php recurrent rule https://github.com/simshaun/recurr/
<?php
public function testThreeMonths()
{
$timezone = 'Asia/Bangkok';
$timezoneObj = new \DateTimeZone($timezone);
/* *\/
$rule = new RecurrenceRule(
'FREQ=MONTHLY;COUNT=5;INTERVAL=3',
new \DateTime('2013-06-13 00:00:00', $timezoneObj),
SELECT p.extracted_code
FROM (
select extracted_code
from policy
group by extracted_code
) AS p
LEFT OUTER JOIN (
SELECT code_cleaned
FROM `commission`
group by code_cleaned
* * * * * PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs /usr/local/bin/casperjs /var/www/javascript/uat/prime.js 2>&1