I hereby claim:
- I am kevinpeno on github.
- I am kevinpeno (https://keybase.io/kevinpeno) on keybase.
- I have a public key whose fingerprint is DE6F C511 90B6 4EB5 7DE3 327B 5E1A FAC9 047F 2E25
To claim this, I am signing this object:
/** | |
* Hack to allow jQuery to work within XHTML documents that define an xmlns | |
*/ | |
/** | |
* Use the given object to override the given methods in its prototype | |
* with namespace-aware equivalents | |
*/ | |
function addNS(obj, methods) { | |
var proto = obj.constructor.prototype; |
CREATE VIEW view_recipe_by_ingredient AS | |
SELECT R.*, RI.liquorID -- Replace R.* with columns in recipes table | |
FROM recipes R | |
JOIN recipeIngredients RI ON RI.recipeID = R.id; | |
CREATE VIEW view_recipes_in_cabinet AS | |
SELECT L.userID, RbI.id, COUNT( RbI.liquorID ) as LiquorCount, RbI.* -- Replace RbI.* with remaining columns in view_recipe_by_ingredient | |
FROM view_recipe_by_ingredient RbI | |
LEFT JOIN liquorCabinet L USING( liquorID ); |
-- ---------------------------- | |
-- Table structures | |
-- If using MySQL, update each table definition to use INNODB or foreign keys will be pointless | |
-- Example: | |
-- CREATE TABLE "Ingredient" ( | |
-- "name" TEXT NOT NULL, | |
-- PRIMARY KEY ("name" ASC) | |
-- ) type INNODB; | |
-- ---------------------------- | |
CREATE TABLE "Ingredient" ( |
<?php | |
# Normal array | |
$startMemory = memory_get_usage(); | |
$array = range( 1, 100000 ); | |
echo ( ( memory_get_usage() - $startMemory ) / 100000 ), " bytes per element\n"; | |
unset( $array, $startMemory ); | |
# stdClass as a simple map/dictionary | |
$startMemory = memory_get_usage(); | |
$array = new stdClass(); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>A test for using object for webp</title> | |
</head> | |
<body> | |
<object data="https://www.gstatic.com/webp/gallery3/1_webp_ll.webp" type="image/webp"> | |
<img src="https://www.gstatic.com/webp/gallery3/1.png"/> | |
</object> | |
</body> |
I hereby claim:
To claim this, I am signing this object:
// Can't import built-in modules? :( | |
const {abs, pow} = Math |
/* | |
ES2015 fat arrow noop | |
*/ | |
() => {} | |
/* | |
My fat arrow noop | |
*/ |
14.2: Arrow Function Definitions | |
ArrowFunction[In, Yield] : | |
ArrowParameters[?Yield] [no LineTerminator here] => ConciseBody[?In] | |
ArrowParameters[Yield] : | |
FormalParameters[?Yield] | |
StrictFormalParameters[?Yield] | |
CoverParenthesizedExpressionAndArrowParameterList[?Yield] |
Hope you've had your coffee. I'm trying to figure out why this works:
state.map((good) => {
if ( good.type === type ) {
return _.assign(good, { amount })
}
else {
return good
}
})