I hereby claim:
- I am dustinsgoodman on github.
- I am dgoodman (https://keybase.io/dgoodman) on keybase.
- I have a public key whose fingerprint is 9D83 9A3E 86A5 2B05 38AD 9BA5 8C59 B2D2 BD6D 05E6
To claim this, I am signing this object:
export default class UserModel { | |
constructor (data) { | |
Object.entries(data).forEach(([key, value]) => { | |
this[key] = value; | |
}); | |
} | |
async update(data) { | |
Object.entries(data).forEach(([key, value]) => { | |
this[key] = value; |
import UserRepo from 'Repos/UserRepo'; | |
export default class UserModel { | |
constructor (data) { | |
Object.entries(data).forEach(([key, value]) => { | |
this[key] = value; | |
}); | |
} | |
async update(data) { |
import UserRepo from 'Repos/UserRepo'; | |
export default class UserModel { | |
static async getByIds(ids) { | |
const users = UserRepo.getByIds(ids); | |
return users.map((user) => new this(user)); | |
} | |
static async getById(id) { | |
const user = UserRepo.getById(id); |
> serverless deploy -s dev | |
Serverless Plugin Error -------------------------------------- | |
Cannot convert undefined or null to object | |
Serverless: WarmUp: setting 2 lambdas to be warm | |
Serverless: WarmUp: user-api-dev-************** | |
Serverless: WarmUp: user-api-dev-************** | |
Serverless: Bundling with Webpack... | |
<--- Last few GCs ---> | |
[438:0x39908e0] 149226 ms: Mark-sweep 1768.9 (2060.1) -> 1768.9 (2045.9) MB, 571.1 / 0.0 ms (average mu = 0.168, current mu = 0.000) allocation failure GC in old space requested | |
[438:0x39908e0] 150360 ms: Mark-sweep 1795.9 (2072.9) -> 1753.4 (2060.1) MB, 972.4 / 0.0 ms (average mu = 0.153, current mu = 0.143) allocation failure GC in old space requested |
<?php | |
namespace MyObject; | |
use Utils\ArrayUtils as _; // basically lodash | |
class DAO extends \Base\MySQL\DAO { | |
// ... | |
/** | |
* Lookup MyObject entities by relationship A. Can additionally filter by relationship B OR C. |
<?php | |
namespace MyObject; | |
use Utils\ArrayUtils as _; // basically lodash | |
class DAO extends \Base\MySQL\DAO { | |
// ... | |
/** | |
* Lookup MyObject entities by relationship A. Can additionally filter by relationship B OR C. |
<?php | |
namespace MyObject; | |
use Utils\ArrayUtils as _; // basically lodash | |
class DAO extends \Base\MySQL\DAO { | |
// ... | |
/** | |
* Lookup MyObject entities by relationship A. Can additionally filter by relationship B OR C. |
<?php | |
namespace MyObject; | |
use Utils\ArrayUtils as _; // basically lodash | |
class DAO extends \Base\MySQL\DAO { | |
// ... | |
/** | |
* @param int|int[] $relationAId |
I hereby claim:
To claim this, I am signing this object:
#Example 1: parsing each line of a file using read and string splitting | |
f = open("/home/sharocko/Documents/Codecademy/output.txt", "r") #open a test file with read mode | |
data = f.read() #read data from the file and store to a variable data | |
data = data.split('\n') #split the string on new lines | |
for line in data: #iterate each line of the string | |
print line.upper() #just print the upper case version of each line | |
f.close() #remember to close the file when you finish | |
#Example 2: using readline() to read data from a file | |
f = open("/home/sharocko/Documents/Codecademy/output.txt", "r") |