Skip to content

Instantly share code, notes, and snippets.

View xujialiang's full-sized avatar

ElliottXU xujialiang

View GitHub Profile
-(void)drawcagradientlayer:(CGRect)rect{
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.colors = @[(id)[UIColor colorWithRed:0 green:0.8 blue:0 alpha:1.0].CGColor, // light gray
(id)[UIColor colorWithRed:0 green:0.8 blue:0 alpha:0.3].CGColor]; // lighter gray
// 创建一个Path句柄
CGMutablePathRef pathRef = CGPathCreateMutable();
// 初始化该path到一个初始点
CGPathMoveToPoint(pathRef, &CGAffineTransformIdentity, kYAxisLabelWidth, rect.size.height/2);
// 添加一条直线,从初始点到该函数指定的坐标点
@xujialiang
xujialiang / gist:6991351
Created October 15, 2013 13:11 — forked from sukum/gist:6991293
Silent install a module loadable package from the command line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
@xujialiang
xujialiang / gist:6991307
Created October 15, 2013 13:08 — forked from sukum/gist:6991293
Silent install a module loadable package from the command line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');