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
+ (NSMutableArray*)createBackupInfoWithCloudBackup:(BOOL)cloudBackup | |
{ | |
// create backup info from backup folder to caches folder | |
NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; | |
//added by WL: make sure no files will be backuped in the libaray dir!! | |
if (!cloudBackup) { | |
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:appLibraryFolder] skip:!cloudBackup]; | |
} | |
NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; | |
NSString* cacheFolder = [appLibraryFolder stringByAppendingPathComponent:@"Caches"]; |
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
fileSystem.getFile( key, {create:true}, function( file ) { | |
if(typeof file.setMetadata === 'function' ){ | |
file.setMetadata(function(){ | |
writeContent(file, error); | |
}, function(){ | |
writeContent(file, error); | |
}, {'com.apple.MobileBackup': 1}); | |
} else { | |
writeContent(file, error); | |
} |
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
Lawnchair.adapter('html5-filesystem', (function (global) { | |
var FileError = global.FileError; | |
var fail = function (e) { | |
var msg; | |
var show = true; | |
switch (e.code) { | |
case FileError.QUOTA_EXCEEDED_ERR: |
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
{ | |
"name" : "Wei", | |
"cluster" : false, | |
"cluster.reseller" : false, | |
"cluster.reseller.customer" : false, | |
"cluster.reseller.customer.domain" : false, | |
"cluster.reseller.customer.domain.project" : true, | |
"cluster.reseller.customer.domain.project.client-apps" : true, | |
"cluster.reseller.customer.domain.project.client-apps.documentation" : true, | |
"cluster.reseller.customer.domain.project.client-apps.source-code" : true, |
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 | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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
# Step 1: Generate the keystore file. | |
# If a keystore file already exists, skip this. | |
keytool -genkey -v -keystore my-release-key.keystore -alias dev -keyalg RSA -keysize 2048 -validity 10000 | |
# Need to remember the password for the keystore file | |
# Step 2: convert the keystore file to PKCS12 format | |
keytool -importkeystore -srckeystore ./my-release-key.keystore -destkeystore newkeystore.p12 -deststoretype PKCS12 -srcalias dev | |
# Step 3: Upload the .p12 file as both the private key file and certificate file to the AppStudio as 1 credential bundle |
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
{ | |
"name": "dev", | |
"description": "Development role", | |
"json_class": "Chef::Role", | |
"default_attributes": { | |
"host_src_dir": "/Users/weili/work/fh/eng/", | |
"feedhenry_common": { | |
"src": "/mnt/src" | |
}, | |
"vm": { |
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
Org::Instances:bootstrap = ppa4 | |
Loading config: /Users/weili/work/fh/chef/fhcap-dev/organisations/ppa4.json | |
The available chef servers are: | |
You are about to run this cmd using your currently configured knife settings, continue? yes | |
/Users/weili/work/fh/chef/fhcap2/lib/fhcap/s3_helper.rb:93:in `require': cannot load such file -- aws/s3 (LoadError) | |
from /Users/weili/work/fh/chef/fhcap2/lib/fhcap/s3_helper.rb:93:in `_get_aws_config' | |
from /Users/weili/work/fh/chef/fhcap2/lib/fhcap/aws_helper.rb:33:in `_get_ec2_client' | |
from /Users/weili/work/fh/chef/fhcap2/lib/fhcap/aws/ec2/instances.rb:13:in `find_instance' | |
from /Users/weili/work/fh/chef/fhcap2/lib/tasks/org_instances.thor:127:in `block (2 levels) in bootstrap' | |
from /Users/weili/work/fh/chef/fhcap2/vendor/bundle/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `call' |
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
enerated at 2015-07-01 15:47:06 +0000 | |
Mixlib::ShellOut::ShellCommandFailed: package[libcurl4-openssl-dev] (gitlab-shell::default line 19) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100' | |
---- Begin output of apt-get -q -y install libcurl4-openssl-dev=7.22.0-3ubuntu4.14 ---- | |
STDOUT: Reading package lists... | |
Building dependency tree... | |
Reading state information... | |
The following packages were automatically installed and are no longer required: | |
git-man liberror-perl | |
Use 'apt-get autoremove' to remove them. | |
Suggested packages: |
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
async.waterfall( | |
[ | |
function getVariants(callback){ | |
//get variants, pass them to the callback | |
return callback(null, variants); | |
}, | |
function(variants, callback){ | |
//if variants is an array, you can nest more async functions | |
async.map(variants, function(variant, cb){ | |
//create variant |