- SQLite’s datetime functions are all UTC, but they don’t explicitly include the timezone information
- In JavaScript (browsers & Node.js) datetimes without explicit timezone information are interpreted as local time
- In servers (for example, DigitalOcean & GitHub Actions machines) the timezone is usually set to UTC
- In development, the timezone is set to the user’s timezone
- We can change the timezone for the Node.js process in macOS/Linux with the TZ=UTC environment variable
- On Windows, the only solution is to temporarily change the OS timezone
- This sounds too heavy-handed and storing datetimes without an explicit timezone seems like a bad idea, anyway
- So the best solution that works everywhere is to avoid using SQLite datetime functions for generating values that will be stored in the database (it’s still fine to use them for queries)
- To be exact, I’m talking about SQLite’s CURRENT_TIMESTAMP, datetime() and so forth
- The correct way of doing it is using the more generic SQLite datetime function
Some time has past (three years!) since I last wrote about API specifically about coroutines style APIs so I thought why not write another one about a different API type I encounter relatively often. The builder API.
Now first let me take a step back and put this into 20,000 feet view on where builder APIs are located in the grant scheme. In general everything in computing is separated into input, processing and finally output. In its most basic form I am currently typing on my keyboard. All pressed keys are processed from the OS up to the browser I am writing this in and finally rendered and displayed on the screen as output. Of course this example is very user centric
This file contains 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
:start | |
call :focus "Title of Window" | |
timeout /t 10 /nobreak > NUL | |
goto start | |
::exit /b | |
:focus | |
setlocal EnableDelayedExpansion | |
if ["%~1"] equ [""] ( |
This file contains 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
#include <poly/Log.h> | |
#include <TestFboChangeBuffer.h> | |
using namespace poly; | |
TestFboChangeBuffer::TestFboChangeBuffer() | |
:fbo(0) | |
,dx(0) | |
{ | |
tex[0] = 0; |
This file contains 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
// fun.cpp | |
extern "C" | |
{ | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
} | |
#include <iostream> |
This file contains 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
#!/bin/bash | |
d=${PWD} | |
sd=${d}/sources | |
bd=${d}/build | |
id=${d}/installed/ | |
PATH_ORIG=${PATH} | |
CC_ORIG=${CC} | |
CPP_ORIG=${CPP} |
This file contains 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
cmake_minimum_required(VERSION 2.8.11) | |
set(bd ${CMAKE_CURRENT_LIST_DIR}) | |
set(id ${bd}) | |
include_directories(${id}) | |
add_executable(test_thread test_thread.cpp) | |
if (WIN32) |
This file contains 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
/* | |
See https://gist.github.com/roxlu/6152fccfdd0446533e1b for the latest version. | |
Author: roxlu | |
Twitter: http://www.twitter.com/roxlu | |
*/ | |
/* ------------------------------------------------------------------------*/ |
This file contains 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
#include <gfx/AsyncUpload.h> | |
namespace gfx { | |
AsyncUpload::AsyncUpload() | |
:width(0) | |
,height(0) | |
,dx(0) | |
,channels(0) | |
,n(0) |
This file contains 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
/* | |
test_fex_load_image | |
------------------- | |
Plain test which loads + reloads a couple of images and reallocating the | |
previously allocated buffer when needed. Just a tiny test to speed up | |
the image loading process. | |
*/ |
NewerOlder