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
| class LocalDateTimeField(with_metaclass(models.SubfieldBase, models.DateTimeField)): | |
| '''A hack/workaround version of DateTimeField that considers the datetime | |
| from the database as local time. | |
| ''' | |
| def to_python(self, value): | |
| from django.utils.dateformat import format | |
| value = models.DateTimeField.to_python(self, value) | |
| if isinstance(value, datetime): | |
| print('-' + repr(value)) | |
| print(strftime('%Y-%m-%d %H:%M:%S.%f', value.timetuple())) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| // url_to_drive.gs | |
| // Google Apps Script | |
| // Allows uploading a URL directly to Google Drive. | |
| // | |
| // Live link: | |
| // https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec | |
| // | |
| // Source-code: | |
| // https://gist.github.com/denilsonsa/8134679 | |
| // https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit |
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
| // digit9brazil.gs | |
| // Google Apps Script | |
| // | |
| // Objective: | |
| // Find mobile phone numbers meeting certain criteria (look inside "updateNumber()" and | |
| // "fixNumbersFromGoogleContacts()" for details) and add a ninth digit to them. | |
| // | |
| // Live link: | |
| // https://script.google.com/macros/s/AKfycbzWlGLgZmA0lygkwMLp3p6RrRFIbBfVdKGXaUAcJCJo59R492E/exec | |
| // |
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
| // cell-color-based-on-value.gs | |
| // | |
| // For more information on using the Spreadsheet API, see | |
| // https://developers.google.com/apps-script/service_spreadsheet | |
| // Returns a linear interpolation of y1,y2 based on x value between x1,x2. | |
| function linearInterp(x, x1, x2, y1, y2) { | |
| if (x <= x1) return y1; | |
| if (x >= x2) return y2; | |
| return y1 + (y2 - y1) * (x - x1) / (x2 - x1); |
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
| NETWORK USER_EXTENSION_NETWORK | |
| NETWORKCOST = -10001 | |
| PRODUCTIONS | |
| USER_STRINGS = | |
| L<'Apple',ci> Out<'épou'> | |
| | L<'aquele',ci> Out<'aquêle'> | |
| | L<'back',ci> Out<'bék'> | |
| | L<'backspace',ci> Out<'békspeice'> | |
| | L<'Bluetooth',ci> Out<'Blutuf'> | |
| | L<'byte',ci> Out<'baite'> |
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/env python | |
| # -*- coding: utf-8 -*- | |
| # vi:ts=4 sw=4 et | |
| #################################################################################### | |
| # The most up-to-date version is available at: # | |
| # https://github.com/denilsonsa/small_scripts/blob/master/watch_website_tkinter.py # | |
| # # | |
| # The code in this Gist is old and obsolete. # | |
| #################################################################################### |
NewerOlder