Skip to content

Instantly share code, notes, and snippets.

Summer summerblue

Block or report user

Report or block summerblue

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
@summerblue
summerblue / PoostApiTest.php
Created Dec 13, 2017
InfyOmLabs/laravel-generator 生成的测试 API 代码
View PoostApiTest.php
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class PoostApiTest extends TestCase
{
use MakePoostTrait, ApiTestTrait, WithoutMiddleware, DatabaseTransactions;
/**
View gist:81adad02997b2860bf2e1b0b3359b8d3

XCode

  • Install XCode from App Store.
  • Open XCode and agree to terms and conditions.

XCode CLI Tools

  • xcode-select --install

Install Homebrew

View Android Studio .gitignore
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@summerblue
summerblue / gist:e34f1c79e100c5deac20
Last active Apr 23, 2017
Using Artisan for backup-manager Auto naming convenience
View gist:e34f1c79e100c5deac20

Introduction

backup-manager is an excelent package, but lack of auto naming feature, here is a workaround using Laravel's Artisan command line tool.

Creating the command

This is the command what we are going to accomplish:

View gist:5d4937e930482d771ee8
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 ys
# Machine name.
function box_name {
View mongodb_aggregation_lbs_search.js
// 找捷運台北車站附近距離2公里內的捷運站
db.lbs_test.aggregate(
{
$geoNear : {
near : [25.046084,121.517542],
distanceField : "dist",
maxDistance : 2 / 111.12
}
}
);
View mongodb_aggregation_lbs_search_orderby_time.js
// 找捷運台北車站附近距離2公里內的捷運站、依照建立時間做排序
db.lbs_test.aggregate(
{
$geoNear : {
near : [25.046084,121.517542],
distanceField : "dist",
maxDistance : 2 / 111.12
}
},
{
View mongodb_aggregation_lbs_search_orderby_time_limit3.js
// 找捷運台北車站附近距離2公里內的捷運站、依照建立時間做排序、找前3筆資料
db.lbs_test.aggregate(
{
$geoNear : {
near : [25.046084,121.517542],
distanceField : "dist",
maxDistance : 2 / 111.12
}
},
{
View mongodb_aggregation_lbs_search_orderby_time_limit3_offset3.js
// 找捷運台北車站附近距離2公里內的捷運站、依照建立時間做排序、找第4、5、6筆的資料
db.lbs_test.aggregate(
{
$geoNear : {
near : [25.046084,121.517542],
distanceField : "dist",
maxDistance : 2 / 111.12
}
},
{
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
You can’t perform that action at this time.