Skip to content

Instantly share code, notes, and snippets.

View galuszkak's full-sized avatar

Kamil Gałuszka galuszkak

View GitHub Profile
@galuszkak
galuszkak / simple_test.py
Created October 8, 2017 12:37
Simple test
import unittest
class FizzBuzzTestCase(unittest.TestCase):
pass
if __name__ == "__main__":
unittest.main()
@galuszkak
galuszkak / keybase.md
Created September 6, 2015 14:46
Keybase proof

Keybase proof

I hereby claim:

  • I am galuszkak on github.
  • I am galuszkak (https://keybase.io/galuszkak) on keybase.
  • I have a public key whose fingerprint is D340 B51B 6143 97F6 2FB6 64F4 4DED 77E0 CF4B 9C51

To claim this, I am signing this object:

var userSchema = new mongoose.Schema({
active: Boolean,
email: { type: String, trim: true, lowercase: true },
firstName: { type: String, trim: true },
lastName: { type: String, trim: true },
sp_api_key_id: { type: String, trim: true },
sp_api_key_secret: { type: String, trim: true },
subs: { type: [mongoose.Schema.Types.ObjectId], default: [] },
created: { type: Date, default: Date.now },
lastLogin: { type: Date, default: Date.now },
@galuszkak
galuszkak / boolean.py
Created August 16, 2014 21:22
Check if something is a boolean in django templates
# save this to your app/templatetags/boolean.py
from django import template
register = template.Library()
@register.filter
def is_boolean(value):
return isinstance(value, bool)
In [1]: import requests
In [2]: response = requests.get('https://api.github.com/repos/pydanny/django-admin2/commits')
In [4]: response.links.items()
Out[4]:
[('first',
{'rel': 'first',
'url': 'https://api.github.com/repositories/10054295/commits?sha=develop'}),
('next',