Skip to content

Instantly share code, notes, and snippets.

View xianxingg's full-sized avatar
😄
morning

xx xianxingg

😄
morning
View GitHub Profile
#include <stdio.h>
#include <string.h>
// 定义 bool 类型
typedef int bool;
#define false 0
#define true 1
/* 本例
@xianxingg
xianxingg / select-many.js
Last active September 21, 2016 08:05
ps select many. use Inspect to get input id, like TZ_SUB_ACT_DWK_TZ_SELECT1$***. Alternatives are the range of i and 'TZ_SUB_ACT_DWK_TZ_SELECT1$'
for (var i = 21; i <= 69; i ++) document.getElementById("ptifrmtgtframe").contentWindow.document.getElementById("TZ_SUB_ACT_DWK_TZ_SELECT1$" + i).click()
@xianxingg
xianxingg / class_decorator.ts
Created May 26, 2016 10:43 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@xianxingg
xianxingg / insert-style.js
Created May 10, 2016 05:28
jquery insert style tag
$( "<style>body { display: block; }</style>" ).appendTo( "head" );
td{mso-number-format:"\@";}
@xianxingg
xianxingg / underscore-which-one.md
Created March 10, 2016 02:26
快速找到应该使用哪个underscore函数
  1. 选出列表中每个object的某一个属性 _.pluck([{a:1, b:11}, {a:2, b:22}], 'a') => [1, 2]
@xianxingg
xianxingg / _.sql
Created March 3, 2016 10:37
From http://stackoverflow.com/questions/15677446/how-to-tweak-listagg-to-support-more-than-4000-character-in-select-query listagg不用做escape(date), 但是xmlagg需要转码, 否则报错: datatype, describeCol
dbms_xmlgen.convert(xmlagg(xmlelement(E, name||',')).extract('//text()').getclobval(),1)
@xianxingg
xianxingg / ie.shims.js
Created March 2, 2016 08:08 — forked from dhm116/ie.shims.js
IE7/8 Javascript method shims
'use strict';
// Add ECMA262-5 method binding if not supported natively
//
if (!('bind' in Function.prototype)) {
Function.prototype.bind= function(owner) {
var that= this;
if (arguments.length<=1) {
return function() {
return that.apply(owner, arguments);
@xianxingg
xianxingg / jQueryPhantomScrape.js
Last active December 30, 2015 07:46 — forked from crazy4groovy/jQueryPhantomScrape
Scrape the web using PhantomJS and jQuery
//This is an example of how to scrape the web using PhantomJS and jQuery:
//source: http://snippets.aktagon.com/snippets/534-How-to-scrape-web-pages-with-PhantomJS-and-jQuery
//http://phantomjs.org/
var page = new WebPage(),
url = 'http://localhost/a-search-form',
stepIndex = 0;
/**
* From PhantomJS documentation:
@xianxingg
xianxingg / example.html
Created December 14, 2015 00:35
vue example
<html>
<head>
<script src="//cdn.bootcss.com/vue/1.0.11/vue.min.js"></script>
</head>
<body>
<div id="app">
<input v-model="newTodo" v-on:keyup.enter="addTodo">
<ul>
<li v-for="todo in todos">