Skip to content

Instantly share code, notes, and snippets.

View oxUnd's full-sized avatar
🔑
多写代码少说话

秋_ oxUnd

🔑
多写代码少说话
  • Harbin Institute of Technology
  • China
View GitHub Profile
@oxUnd
oxUnd / smarty.md
Created March 17, 2014 03:53
使用fis-plus后线上smarty的配置

使用fis-plus后线上smarty的配置

上线时跟源码目录没多大关系了,具体配置是相对于产出目录的;fis-plus产出目录如下

.
├── config
├── plugin
├── static
└── template
@oxUnd
oxUnd / is_numeric.js
Created March 5, 2014 07:48
code snippet
isNumeric: function( obj ) {
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
}
@oxUnd
oxUnd / install-php.md
Last active October 6, 2022 12:24
Mac下安装php-cgi

Mac下安装php-cgi

mac下安装php-cgi有多种方法,这里只介绍比较简单的两个方法;

  • 用brew安装
  • 直接下载安装XAMPP

用brew安装

如果安装了xcode,那么推荐使用brew来安装php。详细使用方法见官网,这里只说明如何装php-cgi;

function getOffset( el ) {
var _x = 0;
var _y = 0;
while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
_x += el.offsetLeft - el.scrollLeft;
_y += el.offsetTop - el.scrollTop;
el = el.offsetParent;
}
return { top: _y, left: _x };
}
var queue = function(funcs, scope) { 
    (function next() { 
          if(funcs.length > 0) { 
              funcs.shift().apply(scope || {}, [next].concat(Array.prototype.slice.call(arguments, 0))); 
          } 
    })(); 
}; 
 
var obj = { 
    value: null 
@oxUnd
oxUnd / gist:8455441
Created January 16, 2014 13:59
rgb to hex
- (NSString *) rgbToHex: (NSColor*) color {
NSString *hexColor = [NSString stringWithFormat:@"#%02X%02X%02X",
(int) ([color redComponent] * 0xFF),
(int) ([color greenComponent] * 0xFF),
(int) ([color blueComponent] * 0xFF)
];
return hexColor;
}
@oxUnd
oxUnd / fis.py
Last active December 29, 2015 09:59
fis collect resource algorithm you can enter to http://pythontutor.com/visualize.html
#!/usr/bin/env python
'''
fis collect resource algorithm
'''
#
# static resoruce
#
collection = {}
if !exists("g:gofmt_command")
let g:gofmt_command = "gofmt -tabs=false -tabwidth=4"
endif
@oxUnd
oxUnd / virtual.cpp
Last active December 28, 2015 04:29
//
// virtual.cpp
//
#include "virtual.h"
Base::~Base() {
}
#ifndef __cpp01__virtual__
#define __cpp01__virtual__
#include <iostream>
class Base {
public:
virtual int print(const char *) = 0;
~Base();