Skip to content

Instantly share code, notes, and snippets.

View wcc526's full-sized avatar

chi-chi weng wcc526

View GitHub Profile
@wcc526
wcc526 / about.ctrl.js
Last active August 29, 2015 14:17
angular form controller
(function(){
'use strict';
angular.module('App')
.controller('AboutFormCtrl',['$scope','$log',function($scope,$log){
$log.debug('AboutFormCtrl');
$scope.age = null;
$scope.generateAges = function(){
var ages = [];
@wcc526
wcc526 / ng-class.html
Created March 15, 2015 07:59
ng-class
<section>
<p>
<p>
<span ng-class="{'label-success':focus}" class="label label-default">Focus!</span>
<span ng-class="{'label-warning':!focus}" class="label label-default">Blur!</span>
</p>
<input ng-model="title" class="form-control" ng-focus="focus=true" ng-blur="focus=false" placeholder="Enter a title for your book"/>
<div class="panel">
<p> <h1> [[ focus ]]</h1> The title of your book is [[ title.length ? title : "No Name" ]] </p>
</div>
@wcc526
wcc526 / ng-include.html
Created March 15, 2015 08:17
ng-include.html
<section>
<h2>ngInclude</h2>
<script type="text/ng-template" id="other.html">
<div>Other Template</div>
</script>
<nav>
<button class="btn btn-primary" ng-click="tpl='other.html'">
load other.html
</button>
<button class="btn btn-primary" ng-click="tpl=null">
@wcc526
wcc526 / circle.drv.js
Created March 15, 2015 08:29
circle.drv.js
.directive('myCircle',function(){
return {
templateUrl: 'circle.html',
replace: true,
controller: ['$scope','$rootScope',function($scope,$rootScope){
$scope.afterClick = function(){
console.log('clicked');
$rootScope.$broadcast('clicked');
}
}],
@wcc526
wcc526 / event.js
Created March 15, 2015 10:21
event.js
.controller('homeListCtrl',['$scope','$rootScope','$http','homeService',
function($scope,$rootScope,$http,homeService){
$scope.selectUser = function(user){
homeService.setCurrentUser(user);
$rootScope.$broadcast('userChanged');
}
}])
@wcc526
wcc526 / ng-table.js
Created March 17, 2015 05:56
angular table
<div ng-init="customers=[{name:'abc',city:'defg'},{name:'def',city:'helo'}]">
<input type="text" ng-model="customerFilter.name"/>
<table>
<tr>
<th ng-click="sortBy='name';reverse=!reverse">Name</th>
<th ng-click="sortBy='city';reverse=!reverse">City</th>
</tr>
<tr ng-repeat="cust in customers | filter:customerFilter.name | orderBy:sortBy:reverse" >
<td>[[ cust.name | uppercase ]]</td>
<td>[[ cust.city | uppercase ]]</td>
@wcc526
wcc526 / gist:50a2ab1651d9ccaa0afb
Created June 22, 2015 13:41
sysbench 性能测试
sysbench --test=cpu --cpu-max-prime=20000 run
sysbench --test=fileio --num-threads=16 --file-rw-ratio=5 \
--file-total-size=300M --file-test-mode=rndrw prepare
sysbench --test=fileio --num-threads=16 --file-rw-ratio=5 \
--file-total-size=300M --file-test-mode=rndrw run
sysbench --test=memory --num-threads=16 \
--memory-block-size=8192 --memory-total-size=1G run
1. alpha release
example 1.2a1
unstable missing features
2. beta release
example 2.3.1b2
feature complete still buggy
3. release candidate
-- The Head Section --
-- https://thesprawl.org/research/writing-nse-scripts-for-vulnerability-scanning/
description = [[Sample script to detect a fictional vulnerability
in a fictional ArcticFission 1.0 web server]]
---
-- @usage
-- nmap --script http-vuln-check <target>
-- @output
-- PORT STATE SERVICE
description = [[ Attempt to get App ]]
author = "wcc526 <949409306@qq.com>"
license = "Same as Nmap"
categoriese = {"default","discovery","safe"}
local shortport = require "shortport"
local http = require "http"
portrule = shortport.port_or_service({80,8081},{"http"})