Skip to content

Instantly share code, notes, and snippets.

View mani95lisa's full-sized avatar

Mani Wang mani95lisa

  • Pamakids
  • BeiJing
View GitHub Profile
var Hapi = require('hapi');
// Declare internals
var internals = {};
internals.main = function () {
var http = new Hapi.Server(812);
<!DOCTYPE html>
<html>
<head>
<title>Pama Static Files</title>
</head>
<body>
<h1>
Pamakids静态文件服务
</h1>
</body>
wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz
tar xzf redis-2.6.13.tar.gz
cd redis-2.6.13
make
mkdir -p /usr/local/bin
cp -pf redis-server /usr/local/bin
cp -pf redis-benchmark /usr/local/bin
cp -pf redis-cli /usr/local/bin
cp -pf redis-check-dump /usr/local/bin
import com.greensock.TimelineLite;
import com.greensock.TweenLite;
import com.greensock.easing.*;
card.z = 300;
card.getChildAt(0).visible = false;
card.getChildAt(0).rotationY = 180;
card.addEventListener(MouseEvent.MOUSE_DOWN,cardDown);
package
{
import flash.display.DisplayObject;
import flash.display.GradientType;
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Matrix;
import flash.geom.Point;
@mani95lisa
mani95lisa / ColorOfPixelInUIView
Created July 16, 2013 11:52
get the color of a pixel in an UIView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint loc = [touch locationInView:self];
self.pickedColor = [self colorOfPoint:loc];
[[NSNotificationCenter defaultCenter] postNotificationName:@"ColorPicked" object:self userInfo:nil];
}
UIViewController * myViewController;
id delegate = [[UIApplication sharedApplication] delegate];
UIWindow * win = [delegate window];
myViewController = [[MyView alloc] init];
// CGRect rect = CGRectMake(x,y,w,h);
// init the view position some how myViewController.viewFrame = rect;
[win addSubview:myViewController.view];
function freeze_db() {
rc = db.runCommand({fsync: 1, lock: 1});
if (rc.ok == 1){
return 1;
} else {
return 0;
}
}
freeze_db();
#!/bin/sh
MONGODB_SHELL='mongo'
DUMP_UTILITY='mongodump'
#SET the bd name which one you want to backup
DB_NAME=''
#SET server path where you want to save the file
CLOUD_PATH=''
db.$cmd.sys.unlock.findOne();