This file contains 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
# cat ./threads.js&& node ./threads.js | |
const WAIT_TIME = 1000; | |
async function sleep(ms) { | |
await new Promise((resolve) => setTimeout(resolve, ms)) | |
} | |
async function thread(n) { |
This file contains 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
/** | |
* The main application class. An instance of this class is created by app.js when it | |
* calls Ext.application(). This is the ideal place to handle application launch and | |
* initialization details. | |
*/ | |
Ext.define('test.Application', { | |
extend: 'Ext.app.Application', | |
name: 'test', |
This file contains 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
/** | |
* The main application class. An instance of this class is created by app.js when it | |
* calls Ext.application(). This is the ideal place to handle application launch and | |
* initialization details. | |
*/ | |
Ext.define('test.Application', { | |
extend: 'Ext.app.Application', | |
name: 'test', |
This file contains 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
/** | |
* The main application class. An instance of this class is created by app.js when it | |
* calls Ext.application(). This is the ideal place to handle application launch and | |
* initialization details. | |
*/ | |
Ext.define('test.Application', { | |
extend: 'Ext.app.Application', | |
name: 'test', |
This file contains 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
- (instancetype)init | |
{ | |
// return [self initWithURL:[RCTConvert NSURL:@"http://localhost:8081/debugger-proxy"]]; | |
NSString *serverIP = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SERVER_IP"]; | |
NSString *debugUrlString = [NSString stringWithFormat:@"http://%@:8081/debugger-proxy", serverIP]; | |
return [self initWithURL:[RCTConvert NSURL:debugUrlString]]; | |
} |
This file contains 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
#if DEBUG | |
#if TARGET_OS_SIMULATOR | |
#warning "DEBUG SIMULATOR" | |
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; | |
#else | |
#warning "DEBUG DEVICE" | |
NSString *serverIP = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SERVER_IP"]; | |
NSString *jsCodeUrlString = [NSString stringWithFormat:@"http://%@:8081/index.ios.bundle?platform=ios&dev=true", serverIP]; | |
NSString *jsBundleUrlString = [jsCodeUrlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
jsCodeLocation = [NSURL URLWithString:jsBundleUrlString]; |
This file contains 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
INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
echo "writing to $INFOPLIST" | |
PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true | |
PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true |
This file contains 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
NODE JS VERSION | |
=============== | |
~/src/tmp cat async-fail.js | |
var async = require('async'), | |
http = require ('http'); | |
var array = []; | |
for (var i=0; i<250; i++) { |
This file contains 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
var myObject = { | |
"foo": true, | |
"author": "simon", | |
"env": 123 | |
} | |
var myProxy = new JavaAdapter(org.mozilla.javascript.NativeObject, { | |
// The "start" argument is here for setters and getters living | |
// on a prototype, so they know what to use as "this"-object. | |
put: function(name, start, value) { |
This file contains 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
Schema.add({ | |
name: 'Content', | |
fields: [ | |
{ name: 'contentId', type: 'int', autoIncrement: true, defaultValue: 0 }, | |
{ name: 'churchId', type: 'int' }, | |
{ name: 'seoFriendly', type: 'varchar', size: 255 }, | |
{ name: 'title', type: 'varchar', size: 255, defaultValue: 'Untitled' }, | |
{ name: 'description', type: 'varchar', size: 255, defaultValue: 'No description' }, | |
{ name: 'body', type: 'longtext' } | |
], |
NewerOlder