This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/openresty/nginx/logs/*.log { | |
weekly | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
sharedscripts | |
postrotate | |
[ -e /usr/local/openresty/nginx/logs/nginx.pid ] && kill -USR1 `cat /usr/local/openresty/nginx/nginx.pid` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
username='username' | |
password='password' | |
database='database' | |
charset='utf8mb4' | |
collate='utf8mb4_unicode_ci' | |
backup=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed and saved. | |
* | |
* Add your own CSS or Less to fully customize Atom. | |
* If you are unfamiliar with Less, you can read more about it here: | |
* http://lesscss.org | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
G H I J | |
\ / \ / | |
D E F | |
\ | / \ | |
\ | / | | |
\|/ | | |
B C | |
\ / | |
\ / | |
A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class AbstractMobileFactory { | |
abstract public function createMobile(); | |
} | |
class AppleFactory extends AbstractMobileFactory { | |
public function createMobile() { | |
return new AppleMobile(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function binary_search($array, $value) { | |
$upper = count($array) -1; | |
$lower = 0; | |
while ($lower <= $upper) { | |
$mid = floor(($lower + $upper) / 2); | |
if ($array[$mid] == $value) { | |
return $mid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" My pathogen | |
try | |
call pathogen#infect('~/.vim/bundle/{}') | |
catch | |
endtry | |
syntax enable | |
set number | |
set numberwidth=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom error response of parse json | |
module MyApp | |
class ParamsParser < ::ActionDispatch::ParamsParser | |
def call(env) | |
super | |
rescue ::MultiJson::DecodeError | |
[400, {'Content-Type' => 'application/json'}, [{message: 'JSON parse error'}.to_json]] | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# god -c config/app.god | |
module YourApp | |
module God | |
def self.generic_monitoring(w, options = {}) | |
# start if process is not running | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 10.seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
:backtrace: falset | |
:benchmark: false | |
:bulk_threshold: 1000 | |
:sources: | |
- https://mirrors.tuna.tsinghua.edu.cn/rubygems/ | |
- https://gems.ruby-china.com/ | |
:update_sources: true | |
:verbose: true | |
#http_proxy: http://proxy.com |
NewerOlder