Skip to content

Instantly share code, notes, and snippets.

@kierenj
kierenj / paging-by-default.md
Created December 19, 2017 14:57
Paging defaults

Paging by default

problems

  • easy to forget default limit is there - get dropdowns with just a few options, etc
  • have to specify arbitrary-ish big number for page_size to remove limit. how to choose?

benefits

  • not having to remember to implement paging

Keybase proof

I hereby claim:

  • I am kierenj on github.
  • I am kierenj (https://keybase.io/kierenj) on keybase.
  • I have a public key ASCsmv9dJfmO3auKt7BlK2LuJI2D5mww4WnzbOmk2H3yawo

To claim this, I am signing this object:

C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\MSBuild.dll /NoLogo /Logger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\dotnet.dll /m /t:Restore /v:m /verbosity:diag .\redscope.csproj
Build started 04/08/2017 07:17:59.
Environment at start of build:
Path = C:\Program Files\Docker\Docker\Resources\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL
-i "C:\Users\kiere\OneDrive\TL\timelapse-atlstwat-1.mp4"
-i "C:\Users\kiere\OneDrive\TL\timelapse-atlstwat-2.mp4"
-i "C:\Users\kiere\OneDrive\TL\timelapse-atlstwat-3.mp4"
-i "C:\Users\kiere\OneDrive\TL\timelapse-atlstwat-4.mp4"
-i "C:\Users\kiere\OneDrive\TL\timelapse-atlstwat-5.mp4"
-filter_complex "
nullsrc=size=3840x2160 [base];
warn: Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryCompilationContextFactory[8]
The LINQ expression 'join Region b.Source in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[MyProj.EntityModel.Region]) on Property([b], "SourceId") equals Convert(Property([b.Source], "Id"))' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
warn: Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryCompilationContextFactory[8]
The LINQ expression 'DefaultIfEmpty()' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when ove
Run,
Cycle,
Walk,
Badminton,
Hike,
Swim,
AlpineSki,
BackcountrySki,
CrossCountrySkiing,
Crossfit,
DELETE http://indriyax:9200/content/news
(gives 200 OK)
PUT http://indriyax:9200/content/news/_mapping
{
"news": {
"properties": {
"TextContent": {
"type": "string",
@kierenj
kierenj / gist:2864586
Created June 3, 2012 18:47
DCPU16 generic vector display device
Name: Generic Vector Display (compatible)
ID: 0x3c704111
Version: 1
A prototype integrated three-dimensional vector display system with electron gun array, highly-fidelity electromagnet drivers and controller electronics.
Display area: 1m^3. Resolution: 1/65536m in each axis (15 microns).
Interrupts do different things depending on contents of the A register:
File entry
----------
Offset: last file offset + last file length
Length: length of file contents
Data: contents of file
Effectively, each file is dumped to disk, one after the other. No index, filenames, or other information is stored.
@kierenj
kierenj / DCPU16 debugger device
Created May 17, 2012 11:54
DCPU16 debugger device
Name: Generic Debugger (compatible)
ID: 0xdeb91111
Version: 1
Interrupts do different things depending on contents of the A register:
A | BEHAVIOR
---+----------------------------------------------------------------------------
0 | Trigger a breakpoint
1 | Output diagnostics word (value in B)