brew service list
brew services start|stop|restart
brew services cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replacer(match, offset, string){ | |
console.log(arguments) | |
return ["x", match, "x"].join(''); | |
}; | |
var str = 'a1b2c3d'; | |
var regex = /\d/ig; | |
var newString = str.replace(regex, replacer); | |
console.log(newString) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* - - - - - - - - - - - - - - - - - - - - - | |
Title : Example Custom CSS : DinoMaster! | |
URL : http://wufoo.com | |
Last Updated : April 1, 2011 | |
- - - - - - - - - - - - - - - - - - - - - | |
INSTRUCTIONS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RANDNUMBER=`shuf -i1-10000 -n1` | |
# echo "RANDNUMBER $RANDNUMBER" | |
cd /mnt/bak | |
# backup files | |
echo "backup files..." | |
cp -r /www/web/brch/public_html /root/bak/public_html_`date +"%Y-%m-%d"`_$RANDNUMBER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY 'backuppassword874'; | |
GRANT SELECT , | |
RELOAD , | |
FILE , | |
SUPER , | |
LOCK TABLES , | |
SHOW VIEW ON *.* TO 'dbbackup'@'localhost' IDENTIFIED BY 'backuppassword874' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. brew安装mysql | |
$ brew install mysql | |
2. 创建或修改/usr/local/etc/my.cnf | |
https://gist.github.com/sandyxu/6317492 | |
3. 初始化 init database | |
$ unset TMPDIR | |
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"]; | |
if (cell == nil) { | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"myCell"]; | |
cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
} | |
cell.textLabel.text = self.justCourseNamesArray[indexPath.row]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create this file in your /root folder | |
$ fleetctl load swapon.service | |
$ fleetctl start swapon.service | |
This will create swap file on all nodes of your CoreOS cluster without prior setup. | |
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// version info | |
// angular.version | |
// Object {full: "1.2.25", major: 1, minor: 2, dot: 25, codeName: "hypnotic-gesticulation"} | |
//filters: | |
.filter('html', function($sce) { | |
return function(text) { | |
return $sce.trustAsHtml(text); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map = %Q{ | |
function() { | |
if (this.mobile_city) { | |
emit(this.mobile_city, 1); | |
} | |
} | |
} | |
reduce = %Q{ | |
function(key, values) { |