I hereby claim:
- I am infecto on github.
- I am drewkowalik (https://keybase.io/drewkowalik) on keybase.
- I have a public key whose fingerprint is 2EED E04E E044 665C 751A 3A32 4B19 3130 F0B3 7E3E
To claim this, I am signing this object:
import mock | |
class foobar(object): | |
def show_me(self): | |
print('the money') | |
no_spec_mock = mock.MagicMock() | |
no_spec_mock.foobar.called |
class Foobar(serializers.ModelSerializer): | |
company_type = serializers.SerializerMethodField('get_company_type') | |
company_code = serializers.Field(source='id') | |
class Meta: | |
model = Customer | |
fields = ('id') | |
def get_company_type(self): | |
return 'consumer' |
I hereby claim:
To claim this, I am signing this object:
that.listenTo(that.model.get('lists'),'all', function(en) { | |
console.log(en); | |
}); |
https://github.com/addyosmani/backbone-fundamentals |
function bind(func, object) { | |
return function () { | |
return func.apply(object, arguments); | |
}; | |
} | |
Function.prototype.myBind = function (context) { | |
var that = this; | |
return function () { | |
return that.apply(context, arguments); |
.headers on | |
.mode column |
SELECT DISTINCT a.yr | |
FROM nobel a | |
LEFT OUTER JOIN nobel b | |
ON a.yr=b.yr | |
AND b.subject NOT IN ('Economics','Literature','Medicine','Peace','Physics') | |
WHERE b.subject IS NULL | |
AND a.subject = 'Physics' |
# c2 c4 | |
# h7 h5 | |
# h2 h4 | |
# a7 a5 | |
# d1 a4 | |
# a8 a6 | |
# a4 a5 | |
# a6 h6 | |
# a5 c7 |
def josephus(count, skip) | |
#catch errors | |
return 0 if count == 1 | |
#base case | |
return count-1 if skip == 1 | |
#generally calls base case | |
if skip>count | |
return (josephus(count-1,skip)+skip) % count |