Skip to content

Instantly share code, notes, and snippets.

View frgtn's full-sized avatar

Saulius Žemaitaitis frgtn

  • Vilnius, Lithuania
View GitHub Profile
@frgtn
frgtn / timetransform.py
Created September 10, 2015 15:42
How to filter Django datetimefield by time component
from django.db import models
class TimeTransform(models.Transform):
lookup_name = 'time'
bilateral = True
def as_sql(self, compiler, connection):
lhs, params = compiler.compile(self.lhs)
return "cast(%s as time)" % lhs, params
### Keybase proof
I hereby claim:
* I am frgtn on github.
* I am frgtn (https://keybase.io/frgtn) on keybase.
* I have a public key whose fingerprint is E95E 12AF 836E 8D15 35FB 37BE 2252 2CAF 6468 BBFA
To claim this, I am signing this object:
<?php
/*
* Copyright 2013 Disqus, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@frgtn
frgtn / gist:649519
Created October 27, 2010 17:24
Radavičiaus asm kontrolinis
;
; Salyga:
; Parasyti programa, kuri kiekviena ivestoje tekstineje eiluteje esanti desimtaini skaiciu pakeicia jo dalybos is 3 liekana ir
; isveda gauta eilute i ekrana. Maksimalus leistinas eilutes ilgis - 255 simboliai.
.model small
.stack 100h
buff_size equ 255
@frgtn
frgtn / gist:647840
Created October 26, 2010 21:23
pirmas uždavinys iš Radavičiaus laiško
.model small
.stack 100h
buff_size equ 254
.data
enter_data db "Enter text:", 10, 13, '$'
newline db 10, 13, '$'