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 / SourtWord.vim
Created April 18, 2015 15:07
SortWord.vim
function! Strcmp(...)
let a1 = a:1
let a2 = a:2
if a1 =~ '^\d\+$'
let a1 = 0 + a1
endif
if a2 =~ '^\d\+$'
let a2 = 0 + a2
endif
@oxUnd
oxUnd / A.adoc
Last active August 29, 2015 14:20
A.adoc

Test

Important
This is a test
Table 1. Table
@oxUnd
oxUnd / fis3.adoc
Last active August 29, 2015 14:20
fis3

FIS3

FIS3 进度

  1. 2015-04-23 进度

    总体进度 65% 正式发布时间预计延期 2

    1. 完成功能开发

    2. 调整参数细节,Review 40%

@oxUnd
oxUnd / _helpers.js
Last active August 29, 2015 14:25 — forked from elclanrs/_helpers.js
Monads in JavaScript
var extend = function(a, b) {
for (var i in b)
a[i] = b[i];
return a;
};
var fluent = function(f) {
return function() {
var clone = extend(Object.create(null), this);
f.apply(clone, arguments);
@oxUnd
oxUnd / post-file.m
Created September 22, 2015 07:08
POST file for Mac
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
[req setHTTPMethod:@"POST"]; // POST 请求
[req setValue: [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundry] forHTTPHeaderField:@"Content-Type"]; //boundry = 0xKhTmLbOuNdArY;可参考 HTTP 协议
[req setValue: @"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36" forHTTPHeaderField: @"User-Agent"];
NSMutableData *postData = [NSMutableData dataWithCapacity:[data length] + 512];
[postData appendData: [[NSString stringWithFormat:@"--%@\r\n", boundry] dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData: [[NSString stringWithFormat: @"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n\r\n", FORM_FLE_INPUT, filename] dataUsingEncoding:NSUTF8StringEncoding]]; // FORM_FLE_INPUT 类似与 <input type="file" name="xxx"> 中的 name 属性值,用来在服务端获取上传的文件,比如 $_FILES['xxx']
@oxUnd
oxUnd / drawRect.m
Created September 23, 2015 17:08
Custom View for cocoa
- (void)drawRect:(CGRect) rect {
// If you plan to do more drawing later, it's a good idea
// to save the graphics state before clipping.
[NSGraphicsContext saveGraphicsState];
long r = random();
long g = random();
long b = random();
NSColor *color = [NSColor colorWithRed: (r * 1.0/(r + g + b)) green: (g * 1.0 / (r + g + b)) blue: (b * 1.0 / (r + g + b)) alpha: 1.0];
@oxUnd
oxUnd / composer.json
Created October 15, 2015 09:42
learning Laravel . Tiny Framework
{
"name": "Tiny",
"require": {
"symfony/http-foundation": "2.7.*",
"symfony/http-kernel": "2.7.*",
"symfony/routing": "2.7.*"
}
}
@oxUnd
oxUnd / .vimrc
Last active July 3, 2022 04:29
.vimrc
call plug#begin()
" Make sure you use single quotes
Plug 'junegunn/seoul256.vim'
Plug 'junegunn/vim-easy-align'
" Group dependencies, vim-snippets depends on ultisnips
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
@oxUnd
oxUnd / rime_fly_convert.js
Last active April 17, 2016 10:35
小鹤双拼双形码表转换到 Rime(官网手心输入法挂表,需要转换为 UTF8)
/**
* @author xiangshouding<[email protected]>
*/
var fs = require('fs');
var util = require('util');
var assert = require('assert');
var argv = process.argv;
@oxUnd
oxUnd / fix_phpunit
Created July 7, 2016 14:48
fixed PHPUnit 4.8.26 of Laravel
#!/usr/bin/env sh
cd `pwd`
p=' "PHPUnit_TextUI_Command" => '$(find . -name '*.php' | xargs grep 'class PHPUnit_TextUI_Command' | awk -F: '{print $1}' | sed 's/\.\/vendor/$vendorDir . "/')'",'
echo $p
fixed=`cat vendor/composer/autoload_classmap.php | grep 'PHPUnit_TextUI_Command'`