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
exports.spawn = function(parent, props) { | |
var key, | |
defs = { | |
_parent: { value: parent, enumerable: true } | |
}; | |
for (key in props) { | |
if (props.hasOwnProperty(key)) { | |
defs[key] = { | |
value : props[key], |
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
diff --git a/php_memcached.c b/php_memcached.c | |
index aecdc4f..7ad6c0d 100644 | |
--- a/php_memcached.c | |
+++ b/php_memcached.c | |
@@ -115,17 +115,17 @@ typedef unsigned long int uint32_t; | |
/**************************************** | |
Payload value flags | |
****************************************/ | |
-#define MEMC_VAL_TYPE_MASK 0xf | |
+#define MEMC_VAL_TYPE_MASK 0x2f |
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
#!/usr/bin/python | |
def lazy_map(func, *sequences): | |
""" | |
Ленивая реализация map, делающая вызовы только при необходимости | |
получения результата, т.е. итерации возвращаемого генератора. | |
При множественном вызове получается чистая композиция функций, т.е. | |
lazy_map(lambda: x+1, lazy_map(lambda x: x+2, [1, 2, 3])) |
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
-# если вы дурак^W как я, и на руби пишете | |
-# в основном в состоянии расширенного сознания, | |
-# то вот вам пример, как делать условия в haml: | |
- if myfreakingvar == 'omg' | |
%p My freaking var is "omg". OMG! | |
-# штука в том, что строки, начинающиеся с «-», | |
-# выполняются как ruby код, а всё, что уровнем | |
-# «ниже» по «дереву» - оборачивается в do .. end |
NewerOlder