This file contains 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
//https://jsbin.com/kekilasuwu/edit?html,css,js,console,output | |
Vue.directive('orderby',{ | |
twoWay: true, | |
isLiteral: true, | |
checked: false, | |
bind: function(el,binding, vNode){ | |
var self = this; | |
const onclick = event => { | |
event.stopPropagation() | |
vNode.context.$emit(binding.expression, event); |
This file contains 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
Vue.directive('jquery-change', { | |
twoWay: true, | |
bind: function() { | |
var self = this; | |
$(self.el).on('change', function() { | |
self.set(this.value); | |
}); | |
}, | |
update: function(data) { | |
if(data) { |
This file contains 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 | |
echo "Get Instance: " | |
fileName="iplist.txt" | |
privateIPFileName="privateIp.txt" | |
iplist=$(aws ec2 describe-instances --filters Name=tag:Name,Values=whoscome | jq -r '.Reservations | .[].Instances[0].NetworkInterfaces[0].Association.PublicIp' > $fileName) | |
privateIp=$(aws ec2 describe-instances --filters Name=tag:Name,Values=whoscome | jq -r '.Reservations | .[].Instances[0].NetworkInterfaces[0].PrivateIpAddress' > $privateIPFileName) | |
i=1 | |
osascript <<EOF | |
tell application "iTerm2" |
This file contains 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
upstream ws_server { | |
server 127.0.0.1:8080; | |
} | |
server { | |
listen 80; | |
server_name 10.1.2.225; | |
location / { | |
proxy_pass http://ws_server/; |
This file contains 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
-- Adapted from these sources: | |
-- http://peterdowns.com/posts/open-iterm-finder-service.html | |
-- https://gist.github.com/cowboy/905546 | |
-- | |
-- Modified to work with files as well, cd-ing to their container folder | |
on run {input, parameters} | |
tell application "Finder" | |
set my_file to first item of input | |
set filetype to (kind of (info for my_file)) | |
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: |
This file contains 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
functions: | |
hello: | |
handler: handler.hello | |
events: | |
- http: | |
path: hello | |
method: get | |
response: | |
contentType: application/json;charset=UTF-8 | |
template: |
This file contains 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
'use strict'; | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
// Map common libraries with aliases | |
var providePlugins = new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
'window.jQuery': 'jquery', |
This file contains 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 | |
class Model extends BaseModel { | |
public $defaultRuleAry = []; //預設規則 | |
public function validation() { //驗證輸入 | |
//根據 $this->defaultRuleAry 來驗證 | |
return true; | |
} | |
public function save(array $options = array()) |
This file contains 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 | |
//Enter your code here, enjoy! | |
function arrayListPointer(...$index): Closure{ | |
$item = array_shift($index); | |
$composeIndex = count($index) > 0 ? arrayListPointer(...$index) : function($x) { | |
return $x; | |
}; | |
return function($x) use ($item, $composeIndex) { | |
return '['.$item.']'.$composeIndex($x); | |
}; |
This file contains 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
try { | |
//do something | |
} catch (\Exception $ex){ | |
//Write to Log | |
echo $ex->getMessage(); | |
} |